fix(picker.actions): added hack to make folds work. Fixes #514

This commit is contained in:
Folke Lemaitre 2025-01-16 23:11:55 +01:00
parent 566f302903
commit df1060fa50
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -50,6 +50,13 @@ function M.edit(picker)
-- center
vim.cmd("norm! zzzv")
end
-- HACK: this should fix folds
if vim.wo.foldmethod == "expr" then
vim.schedule(function()
vim.opt.foldmethod = "expr"
end)
end
if current_empty and vim.api.nvim_buf_is_valid(current_buf) then
vim.api.nvim_buf_delete(current_buf, { force = true })
end