From 378394d3dc6bd0d478cfea35444699b1febf89d7 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Thu, 12 Oct 2023 00:11:56 +0200 Subject: [PATCH] try ufo again --- lua/custom/plugins/folding.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lua/custom/plugins/folding.lua b/lua/custom/plugins/folding.lua index 99be137..7821390 100644 --- a/lua/custom/plugins/folding.lua +++ b/lua/custom/plugins/folding.lua @@ -30,17 +30,16 @@ end return { 'kevinhwang91/nvim-ufo', dependencies = 'kevinhwang91/promise-async', - enabled = false, event = 'BufReadPost', init = function() - -- INFO fold commands usually change the foldlevel, which fixes folds, e.g. + -- INFO: fold commands usually change the foldlevel, which fixes folds, e.g. -- auto-closing them after leaving insert mode, however ufo does not seem to -- have equivalents for zr and zm because there is no saved fold level. -- Consequently, the vim-internal fold levels need to be disabled by setting -- them to 99 - vim.opt.foldlevel = 99 - vim.opt.foldlevelstart = 99 - vim.opt.foldcolumn = 'auto' + vim.o.foldlevel = 99 + vim.o.foldlevelstart = 99 + vim.o.foldcolumn = 'auto' end, opts = { provider_selector = function(_, ft, _)