-- 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'
:e test.cpp
:vsplit
zM
Expected behavior
It should also highlight the folded text in the right window
It's the limitation of ufo. ufo use extmarks which is buffer related. No way to make two windows with the same buffer highlighting
folded line correctly.
Neovim version (nvim -v | head -n1)
NVIM 0.7.2
Operating system/version
Linux
How to reproduce the issue
cat mini.lua
nvim --clean +'so mini.lua'
:e test.cpp
:vsplit
zM
Expected behavior
It should also highlight the folded text in the right window
Actual behavior