fix(picker.preview): clear buftype for file previews

This commit is contained in:
Folke Lemaitre 2025-01-21 12:24:16 +01:00
parent 317a2093ea
commit 5429dff1cd
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -84,6 +84,7 @@ function M.file(ctx)
-- re-use existing preview when path is the same
if path ~= Snacks.picker.util.path(ctx.prev) then
ctx.preview:reset()
vim.bo[ctx.buf].buftype = ""
local name = vim.fn.fnamemodify(path, ":t")
ctx.preview:set_title(ctx.item.title or name)