Skip to content

Commit bea6665

Browse files
committed
fix(actions): re-set window-local(!) foldexpr
Problem: Buffers opened from telescope do not have `foldexpr` set properly. Previous workarounds didn't respect foldenable. Solution: Only reset window-local `foldexpr` value instead of global value.
1 parent 3f8109c commit bea6665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/telescope/actions/set.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ action_set.edit = function(prompt_bufnr, command)
202202
end
203203

204204
-- HACK: fixes folding: https://github.com/nvim-telescope/telescope.nvim/issues/699
205-
if vim.wo.foldmethod == "expr" then
205+
if vim.wo[0][0].foldmethod == "expr" then
206206
vim.schedule(function()
207-
vim.cmd "normal! zX"
207+
vim.wo[0][0].foldmethod = "expr"
208208
end)
209209
end
210210

0 commit comments

Comments
 (0)