-- 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 file (sample1.md but any file with "foldable" text will do)
Execute zM to fold everything
split that file/buffer in a new window:2
Go to the new split window:2, and open another file/buffer (sample2.md)
Go back to the first split window:1 (sample1.md) and start to unfold whatever you'd like and make sure to add additional lines of text on those unfolded lines
Go back to the previous split window:2 (sample2.md) and now reopen the previous file (sample1.md) in this split window.
When you do that, notice how the "state" of the folds gets messy
...
Wasn't able to find the ~/.cache/nvim/ufo.log file
Expected behavior
Maybe reopening a previously folded buffer should have the very same fold state in the split/vsplit
Actual behavior
The fold state gets messy after trying to reopen a previously folded buffer
Neovim version (nvim -v | head -n1)
nvim 0.10... dev
Operating system/version
arch linux latest
How to reproduce the issue
cat mini.lua
nvim --clean +'so mini.lua'
zM
to fold everythingsplit
that file/buffer in a new window:2Wasn't able to find the
~/.cache/nvim/ufo.log
fileExpected behavior
Maybe reopening a previously folded buffer should have the very same fold state in the split/vsplit
Actual behavior
The fold state gets messy after trying to reopen a previously folded buffer