fix(picker): initial preview state when main

This commit is contained in:
Folke Lemaitre 2025-02-06 21:24:13 +01:00
parent 270250cf46
commit cd6e336ec0
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -335,7 +335,7 @@ function M:init_layout(layout)
end end
end, { buf = true, nested = true }) end, { buf = true, nested = true })
self.preview:update(preview_main and not preview_hidden and self.main or nil) self.preview:update(preview_main and self.main or nil)
-- apply box highlight groups -- apply box highlight groups
local boxwhl = Snacks.picker.highlight.winhl("SnacksPickerBox") local boxwhl = Snacks.picker.highlight.winhl("SnacksPickerBox")
for _, win in pairs(self.layout.box_wins) do for _, win in pairs(self.layout.box_wins) do
@ -511,7 +511,7 @@ function M:show()
end end
self.shown = true self.shown = true
self.layout:show() self.layout:show()
if self.preview.main then if self.preview.main and self:preview_opts().enabled then
self.preview.win:show() self.preview.win:show()
end end
self:_focus() self:_focus()