Skip to content

Commit 79e9f65

Browse files
committed
fix: fix spinner not disappearing
1 parent c3e78c7 commit 79e9f65

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lua/CopilotChat/chat.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ local Chat = class(function(self, mark_ns, help, on_buf_create, config)
4949
end
5050

5151
if not self.spinner then
52-
self.spinner = Spinner(bufnr, mark_ns, 'copilot-chat', config.notify_when_done)
52+
self.spinner = Spinner(bufnr, mark_ns, 'copilot-chat', config.notify_done)
5353
else
5454
self.spinner.bufnr = bufnr
5555
end

lua/CopilotChat/spinner.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ local spinner_frames = {
2020
'',
2121
}
2222

23-
local Spinner = class(function(self, bufnr, ns, title, notify_when_done)
23+
local Spinner = class(function(self, bufnr, ns, title, notify_done)
2424
self.ns = ns
2525
self.bufnr = bufnr
2626
self.title = title
2727
self.timer = nil
2828
self.index = 1
29-
self.b_notify_when_done = notify_when_done
29+
self.b_notify_when_done = notify_done
3030
end)
3131

3232
function Spinner:start()
@@ -79,7 +79,9 @@ function Spinner:finish()
7979
timer:stop()
8080
timer:close()
8181

82-
local config = require('CopilotChat.init').config
82+
-- Clear the extmark
83+
vim.api.nvim_buf_del_extmark(self.bufnr, self.ns, self.ns)
84+
8385
if self.b_notify_when_done then
8486
vim.notify('Done!', vim.log.levels.INFO, { title = self.title })
8587
end

0 commit comments

Comments
 (0)