mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker): don't render list when closed. See #1308
This commit is contained in:
parent
7769d7e2df
commit
681ae6e307
2 changed files with 6 additions and 3 deletions
|
@ -12,6 +12,9 @@ local M = {}
|
|||
---@param picker snacks.Picker
|
||||
---@param path string
|
||||
function M.reveal(picker, path)
|
||||
if picker.closed then
|
||||
return
|
||||
end
|
||||
for item, idx in picker:iter() do
|
||||
if item.file == path then
|
||||
picker.list:view(idx)
|
||||
|
|
|
@ -366,9 +366,6 @@ function M:update(opts)
|
|||
if self.paused and #self.items < self.state.height then
|
||||
return
|
||||
end
|
||||
if not self.win:valid() then
|
||||
return
|
||||
end
|
||||
self:render()
|
||||
end
|
||||
|
||||
|
@ -553,6 +550,9 @@ function M:update_cursorline()
|
|||
end
|
||||
|
||||
function M:render()
|
||||
if not self.win:valid() then
|
||||
return
|
||||
end
|
||||
stats.render = stats.render + 1
|
||||
if self.target then
|
||||
self:view(self.target.cursor, self.target.top, false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue