kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.18k stars 38 forks source link

When I press esc, the fold will reset #102

Closed wiizard-chen closed 1 year ago

wiizard-chen commented 1 year ago

Neovim version (nvim -v | head -n1)

NVIM v0.8.1

Operating system/version

macOS 12.6

How to reproduce the issue

cat mini.lua

-- 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

20230104140827_rec_

kevinhwang91 commented 1 year ago

Check out your foldlevel .