fix(picker): don't focus a picker window when toggling a window and picker wasn't current. closes #2417

This commit is contained in:
Folke Lemaitre 2025-11-02 16:20:39 +01:00
parent ecc21bbb9b
commit b80b330091
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -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)