Skip to content

Commit

Permalink
fix(split): no fold find if foldexpr setup (#166)
Browse files Browse the repository at this point in the history
foldlevel computing can manually trigger with `zx`, so we just need recompute foldlevel after setup filetype to json | html | text
  • Loading branch information
wenjinnn authored May 31, 2024
1 parent 4a40321 commit 42df991
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/hurl/split.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 42df991

Please sign in to comment.