diff --git a/lua/gemini/init.lua b/lua/gemini/init.lua index eedc0dd..64b046b 100644 --- a/lua/gemini/init.lua +++ b/lua/gemini/init.lua @@ -112,16 +112,15 @@ local function update_chat_window(new_content) end end) end, { buffer = chat_bufnr, nowait = true }) - end - -- Make buffer modifiable - vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', true) - - -- Initialize with content (without separator) - vim.api.nvim_buf_set_lines(chat_bufnr, 0, -1, false, vim.split(new_content, "\n")) - - -- Make buffer unmodifiable - vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', false) + -- Make buffer modifiable + vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', true) + + -- Initialize with content (without separator) + vim.api.nvim_buf_set_lines(chat_bufnr, 0, -1, false, vim.split(new_content, "\n")) + + -- Make buffer unmodifiable + vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', false) else -- Make buffer modifiable vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', true)