From ef8fca047b7f2283d8b9a95702563c270d999640 Mon Sep 17 00:00:00 2001 From: wenjin Date: Tue, 28 May 2024 21:25:04 +0800 Subject: [PATCH] fix(split): no fold find if foldexpr setup foldlevel computing can manually trigger with `zx`, so we just need recompute foldlevel after setup filetype to json | html | text --- lua/hurl/split.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/hurl/split.lua b/lua/hurl/split.lua index 48b9664..6a4ff19 100644 --- a/lua/hurl/split.lua +++ b/lua/hurl/split.lua @@ -57,6 +57,8 @@ M.show = function(data, type) -- After 200ms, the highlight will be applied vim.defer_fn(function() vim.bo[split.bufnr].filetype = type + -- recomputing foldlevel, this is needed if we setup foldexpr + vim.api.nvim_feedkeys('zx', 'n', true) end, 200) local function quit()