diff --git a/lua/parrot/chat_handler.lua b/lua/parrot/chat_handler.lua index 6af10ac..0d92f73 100644 --- a/lua/parrot/chat_handler.lua +++ b/lua/parrot/chat_handler.lua @@ -510,6 +510,9 @@ function ChatHandler:chat_new(params, chat_prompt) return self:_new_chat(params, true, chat_prompt) end + if params.args == "" then + params.args = self.options.toggle_target + end return self:_new_chat(params, false, chat_prompt) end diff --git a/lua/parrot/response_handler.lua b/lua/parrot/response_handler.lua index 3ffef93..ca62dca 100644 --- a/lua/parrot/response_handler.lua +++ b/lua/parrot/response_handler.lua @@ -67,7 +67,13 @@ function ResponseHandler:handle_chunk(qid, chunk) self.first_line = vim.api.nvim_buf_get_extmark_by_id(self.buffer, self.ns_id, self.ex_id, {})[1] local line_count = #vim.split(self.response, "\n") - vim.api.nvim_buf_set_lines(self.buffer, self.first_line + self.finished_lines, self.first_line + line_count, false, {}) + vim.api.nvim_buf_set_lines( + self.buffer, + self.first_line + self.finished_lines, + self.first_line + line_count, + false, + {} + ) self:update_response(chunk) self:update_buffer()