From e6c1867a6813922187a3b5f96de81590d603c701 Mon Sep 17 00:00:00 2001 From: Jonas Widen Date: Sun, 16 Mar 2025 17:47:41 +0100 Subject: [PATCH] Minor fix --- lua/gemini/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) 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