kevinhwang91 / nvim-ufo

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

Loss highlight when buffer is visible in multiple windows #77

Closed skt041959 closed 1 year ago

skt041959 commented 1 year ago

Neovim version (nvim -v | head -n1)

NVIM 0.7.2

Operating system/version

Linux

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. :e test.cpp
  2. :vsplit
  3. zM

Expected behavior

It should also highlight the folded text in the right window

Actual behavior

image

kevinhwang91 commented 1 year ago

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.