Minor fix
This commit is contained in:
parent
9981f45c74
commit
6c4aa6604a
@ -175,10 +175,12 @@ local function gemini_query(prompt, context)
|
|||||||
for i = #lines, 1, -1 do
|
for i = #lines, 1, -1 do
|
||||||
if lines[i]:match("^Assistant: Thinking...") then
|
if lines[i]:match("^Assistant: Thinking...") then
|
||||||
vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', true)
|
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
|
-- Split response into lines and insert "Assistant: " at the start of first line
|
||||||
local response_lines = vim.split(response, "\n")
|
local response_lines = vim.split(response, "\n")
|
||||||
response_lines[1] = "Assistant: " .. response_lines[1]
|
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)
|
vim.api.nvim_buf_set_option(chat_bufnr, 'modifiable', false)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user