-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Neovim version (nvim -v | head -n1)
NVIM v0.10.0-dev-743+g9b5f58185-Homebrew
Operating system/version
MacOS 14.0
How to reproduce the issue
- Use the following config for nvim-ufo (via lazy.nvim):
return {
'kevinhwang91/nvim-ufo',
init = function ()
vim.keymap.set('n', 'zR', function ()
require('ufo').openAllFolds()
end)
vim.keymap.set('n', 'zR', function ()
require('ufo').closeAllFolds()
end)
end,
opts = {
provider_selector = function(bufnr, filetype, buftype)
return {'treesitter', 'indent'}
end
},
dependencies = {
'kevinhwang91/promise-async'
},
event = "BufReadPost",
}
- Open markdown file and add something like this:
# test
test
# new header
- Move cursor to line under
# test
and fold (e.g. withzc
) - Notice it includes the empty lines.
nvim-treesitter
does not do this. It trims these emtpy lines from the region here.
Expected behavior
# test...
# new header
Expect it to use treesitter to get its folds, and thus exclude empty lines from fold. This behaviour can be seen by disabling nvim-ufo (in the lazy.nvim config above, add enabled = false
). Restart nvim and run: set foldmethod=expr foldexpr=nvim_treesitter#foldexpr()
. This should exclude the empty lines in the fold.
Actual behavior
# test...
# new header
It includes the empty lines in the fold.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working