mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker): don't focus a picker window when toggling a window and picker wasn't current. closes #2417
This commit is contained in:
parent
ecc21bbb9b
commit
b80b330091
1 changed files with 3 additions and 0 deletions
|
|
@ -529,6 +529,9 @@ function M:toggle(win, opts)
|
|||
self.layout:toggle(win, opts.enable, function(enabled)
|
||||
-- called if changed and before updating the layout
|
||||
local focus = opts.focus == true and win or opts.focus or self:current_win() --[[@as string]]
|
||||
if not focus then
|
||||
return
|
||||
end
|
||||
if not enabled then
|
||||
-- make sure we don't lose focus when toggling off
|
||||
self:focus(focus)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue