mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker.list): reset preview when no results. Closes #1133
This commit is contained in:
parent
e326de9e0c
commit
f8bc1192cb
1 changed files with 7 additions and 1 deletions
|
@ -89,7 +89,6 @@ function M.new(picker)
|
|||
},
|
||||
})
|
||||
self.visible = {}
|
||||
self.visible_count = 0
|
||||
self.win = Snacks.win(win_opts)
|
||||
self.top, self.cursor = 1, 1
|
||||
self.items = {}
|
||||
|
@ -291,6 +290,13 @@ function M:clear()
|
|||
self.topk:clear()
|
||||
self.top, self.cursor = 1, 1
|
||||
self.items = {}
|
||||
if self._current then
|
||||
vim.schedule(function()
|
||||
if self.picker then
|
||||
self.picker:show_preview()
|
||||
end
|
||||
end)
|
||||
end
|
||||
self._current = nil
|
||||
self.dirty = true
|
||||
if next(self.items) == nil then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue