From 10d0ce4f4f9efa5791ba7d1f218441764d45a813 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Wed, 30 Jul 2025 12:01:27 +0200 Subject: [PATCH] fix(ui): fix check for auto follow cursor Signed-off-by: Tomas Slusny --- lua/CopilotChat/init.lua | 2 -- lua/CopilotChat/ui/chat.lua | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) 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()