From 6c4aa6604aee1818ab95bc0b48c774a10820b9cd Mon Sep 17 00:00:00 2001 From: Jonas Widen Date: Sun, 16 Mar 2025 18:21:32 +0100 Subject: [PATCH] Minor fix --- lua/gemini/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/gemini/init.lua b/lua/gemini/init.lua index 5914ad1..dabf264 100644 --- a/lua/gemini/init.lua +++ b/lua/gemini/init.lua @@ -175,10 +175,12 @@ local function gemini_query(prompt, context) for i = #lines, 1, -1 do if lines[i]:match("^Assistant: Thinking...") then vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', true) + -- Remove the "Thinking..." line + vim.api.nvim_buf_set_lines(chat_bufnr, i, i + 1, false, {}) -- Split response into lines and insert "Assistant: " at the start of first line local response_lines = vim.split(response, "\n") response_lines[1] = "Assistant: " .. response_lines[1] - vim.api.nvim_buf_set_lines(chat_bufnr, i, i + 1, false, response_lines) + vim.api.nvim_buf_set_lines(chat_bufnr, i, i, false, response_lines) vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', false) break end