fix(picker): don't try showing the preview when the picker is closed. Fixes #714

This commit is contained in:
Folke Lemaitre 2025-01-23 12:46:44 +01:00
parent ce3f42e582
commit 11c0761055
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -347,10 +347,13 @@ end
--- Actual preview code
---@hide
function M:_show_preview()
if self.closed then
return
end
if self.opts.on_change then
self.opts.on_change(self, self:current())
end
if not self.preview.win:valid() then
if not (self.preview and self.preview.win:valid()) then
return
end
self.preview:show(self)