-- 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'
1.
2.
3.
...
Expected behavior
First, fold all code (zM)
Next, jump someone fold code scope, and press zO
And type some string and escape insert mode, and the code keep expand
Actual behavior
First, fold all code (zM)
Next, jump someone fold code scope, and press zO
Type some string and escape insert mode
But the code scope become fold status
Neovim version (nvim -v | head -n1)
NVIM v0.8.1
Operating system/version
macOS 12.6
How to reproduce the issue
cat mini.lua
nvim --clean +'so mini.lua'
1. 2. 3. ...
Expected behavior
First, fold all code (zM) Next, jump someone fold code scope, and press zO And type some string and escape insert mode, and the code keep expand
Actual behavior
First, fold all code (zM) Next, jump someone fold code scope, and press zO Type some string and escape insert mode But the code scope become fold status