mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(win): close help when leaving the win buffer
This commit is contained in:
parent
e1566a483d
commit
4aba559c6e
1 changed files with 3 additions and 0 deletions
|
@ -372,6 +372,9 @@ function M:toggle_help(opts)
|
|||
self:on("WinClosed", function()
|
||||
win:close()
|
||||
end, { win = true })
|
||||
self:on("BufLeave", function()
|
||||
win:close()
|
||||
end, { buf = true })
|
||||
local dim = win:dim()
|
||||
local cols = math.floor((dim.width - 1) / col_width)
|
||||
local rows = math.ceil(#self.keys / cols)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue