mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 19:28:24 +00:00
fix(picker): don't try showing the preview when the picker is closed. Fixes #714
This commit is contained in:
parent
ce3f42e582
commit
11c0761055
1 changed files with 4 additions and 1 deletions
|
@ -347,10 +347,13 @@ end
|
||||||
--- Actual preview code
|
--- Actual preview code
|
||||||
---@hide
|
---@hide
|
||||||
function M:_show_preview()
|
function M:_show_preview()
|
||||||
|
if self.closed then
|
||||||
|
return
|
||||||
|
end
|
||||||
if self.opts.on_change then
|
if self.opts.on_change then
|
||||||
self.opts.on_change(self, self:current())
|
self.opts.on_change(self, self:current())
|
||||||
end
|
end
|
||||||
if not self.preview.win:valid() then
|
if not (self.preview and self.preview.win:valid()) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.preview:show(self)
|
self.preview:show(self)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue