-- Use Vim packages install the plugin, also work with some plugins manager such as packer.nvim
vim.o.packpath = '~/.local/share/nvim/site'
vim.cmd('packadd promise-async')
vim.cmd('packadd nvim-ufo')
-- Setting
vim.o.foldcolumn = '1'
vim.o.foldlevel = 99
vim.o.foldlevelstart = -1
vim.o.foldenable = true
local ufo = require('ufo')
ufo.setup()
vim.keymap.set('n', 'zR', ufo.openAllFolds)
vim.keymap.set('n', 'zM', ufo.closeAllFolds)
nvim --clean +'so mini.lua'
Open a buffer. <C-w>v to open another split with the same buffer.
In the new split, close any fold.
Close the same fold in the original split.
Move to the new split again, and try to open it.
...
Expected behavior
The fold should be opened normally
Actual behavior
Instead, it glitches as if it had entered a loop, where the highlight on open is never cleared:
Neovim version (nvim -v | head -n1)
NVIM v0.10.0-dev-1854+g224b2ec202
Operating system/version
Linux 6.6.6
How to reproduce the issue
cat mini.lua
nvim --clean +'so mini.lua'
<C-w>v
to open another split with the same buffer.Expected behavior
The fold should be opened normally
Actual behavior
Instead, it glitches as if it had entered a loop, where the highlight on open is never cleared: