diff --git a/lua/gemini/chat.lua b/lua/gemini/chat.lua index e803871..b13b51f 100644 --- a/lua/gemini/chat.lua +++ b/lua/gemini/chat.lua @@ -111,13 +111,16 @@ function M.create_window() end end -function M.update_content(content, is_new_chat) +function M.update_content(content, is_new_chat, is_thinking) vim.api.nvim_buf_set_option(state.bufnr, 'modifiable', true) local lines = vim.split(content, "\n") - if #state.conversation_history > 1 then -- Check if there's more than one message - -- Add separator before new content + -- Only add separator if: + -- 1. Not the first message + -- 2. Not a thinking message + -- 3. There's existing content in the buffer + if not is_thinking and not is_new_chat and vim.api.nvim_buf_line_count(state.bufnr) > 0 then local separator = "━━━━━━━━━━━━━━━━━━━━━━━━━━" table.insert(lines, 1, separator) end