diff --git a/lua/CopilotChat/init.lua b/lua/CopilotChat/init.lua index 39e40959..5baa0fa8 100644 --- a/lua/CopilotChat/init.lua +++ b/lua/CopilotChat/init.lua @@ -970,8 +970,6 @@ function M.ask(prompt, config) content = '\n' .. tool.result .. '\n', }) end - - M.chat:follow() end local ask_ok, ask_response = pcall(client.ask, client, prompt, { diff --git a/lua/CopilotChat/ui/chat.lua b/lua/CopilotChat/ui/chat.lua index bcd513fd..55964682 100644 --- a/lua/CopilotChat/ui/chat.lua +++ b/lua/CopilotChat/ui/chat.lua @@ -501,7 +501,7 @@ function Chat:append(str) local current_pos = vim.api.nvim_win_get_cursor(self.winnr) local line_count = vim.api.nvim_buf_line_count(self.bufnr) -- Follow only if the cursor is currently at the last line. - should_follow_cursor = current_pos[1] == line_count + should_follow_cursor = current_pos[1] >= line_count - 1 end local last_line, last_column, _ = self:last()