diff --git a/lua/gemini/init.lua b/lua/gemini/init.lua index 18bfd17..c2930d8 100644 --- a/lua/gemini/init.lua +++ b/lua/gemini/init.lua @@ -157,6 +157,14 @@ local function gemini_query(prompt, context) if response then local formatted_content = "\nUser: " .. prompt .. "\n\nAssistant: " .. response update_chat_window(formatted_content) + + -- Move focus to chat window + if chat_winnr and vim.api.nvim_win_is_valid(chat_winnr) then + vim.api.nvim_set_current_win(chat_winnr) + end + + -- Clear the command line + vim.cmd('echo ""') else vim.notify("Failed to get a response from Gemini API", vim.log.levels.ERROR) end