From c436e6456ca546d5a010a2268272500eb442240f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 3 Oct 2023 19:14:55 +0200 Subject: [PATCH] fix(actions): fixes folding. Fixes #699 --- lua/telescope/actions/set.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index 886c47d9f9..cb8dc793ee 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -201,6 +201,13 @@ action_set.edit = function(prompt_bufnr, command) end end + -- HACK: fixes folding: https://github.com/nvim-telescope/telescope.nvim/issues/699 + if vim.wo.foldmethod == "expr" then + vim.schedule(function() + vim.opt.foldmethod = "expr" + end) + end + local pos = vim.api.nvim_win_get_cursor(0) if col == nil then if row == pos[1] then