mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker.list): resize when needed. Closes #2290
This commit is contained in:
parent
ad6cbc8d5d
commit
df018edfdb
1 changed files with 9 additions and 4 deletions
|
|
@ -119,11 +119,16 @@ function M.new(picker)
|
|||
end)
|
||||
|
||||
self.win:on("WinResized", function()
|
||||
if vim.tbl_contains(vim.v.event.windows, self.win.win) then
|
||||
self.state.height = vim.api.nvim_win_get_height(self.win.win)
|
||||
self.dirty = true
|
||||
self:update()
|
||||
if not self.win:win_valid() then
|
||||
return
|
||||
end
|
||||
local height = vim.api.nvim_win_get_height(self.win.win)
|
||||
if height == self.state.height then
|
||||
return
|
||||
end
|
||||
self.state.height = height
|
||||
self.dirty = true
|
||||
self:update()
|
||||
end)
|
||||
|
||||
-- reset topline. Only needed for Neovim < 0.11,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue