We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 394b5cb commit 61f75a7Copy full SHA for 61f75a7
1 file changed
lua/copilot/panel.lua
@@ -371,10 +371,16 @@ function panel:ensure_winid()
371
group = self.augroup,
372
pattern = tostring(self.winid),
373
callback = function()
374
+ local should_jump_to_prev_win = self.winid == vim.api.nvim_get_current_win()
375
+
376
self.panelId = nil
377
self.state = { entries = {} }
378
vim.api.nvim_clear_autocmds({ group = self.augroup })
379
self.winid = nil
380
381
+ if should_jump_to_prev_win then
382
+ vim.cmd("wincmd p")
383
+ end
384
end,
385
desc = "[copilot] (panel) win closed cleanup",
386
once = true,
0 commit comments