diff --git a/lua/gemini/init.lua b/lua/gemini/init.lua index d088328..7c9fd71 100644 --- a/lua/gemini/init.lua +++ b/lua/gemini/init.lua @@ -82,7 +82,11 @@ local function update_chat_window(new_content) vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', false) -- Scroll to bottom - vim.api.nvim_win_set_cursor(chat_winnr, {vim.api.nvim_buf_line_count(chat_bufnr), 0}) + local line_count = vim.api.nvim_buf_line_count(chat_bufnr) + vim.api.nvim_win_set_cursor(chat_winnr, {line_count, 0}) + + -- Ensure the last line is visible + vim.api.nvim_command('normal! zz') -- Return focus to the previous window vim.cmd('wincmd p')