You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, when using a plugin like nvim-ufo which captures the highlights of a line for the folding text, the MatchParen/MatchParenCur highlight persists in the fold text until the user moves the cursor over the specific corresponding bracket, then moves back off of it.
What vim version are you using? NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1700008891
Using Tree-sitter vim-matchup
Steps to reproduce: Fold some lines of code while the cursor is on an open bracket character
Expected behavior: The MatchParen highlight will be cleared upon folding (as it would when moving the cursor)
Observed behavior: The highlight remains in the fold text, and stays when the cursor moves anywhere, only disappearing if, say, the cursor was on the closing bracket in the first place, then folded, such that the cursor would eventually move off of the bracket properly. This bug only affects when folding while the cursor is over an open bracket, for some reason.
Minimal working example
Please provide a minimal working example, e.g.,
print {
'hi',
}
print('hi')
Observe that when folding from the last character of line 1, the fold text keeps the MatchParen highlight when the cursor moves anywhere. If folding from line 3, the highlight is also applied initially but disappears properly upon moving the cursor anywhere.
Minimal vimrc file
Minimal setup (derived from the lazy.nvim package manager):
localroot=vim.fn.fnamemodify('./.repro', ':p')
-- set stdpaths to use .reprofor_, nameinipairs { 'config', 'data', 'state', 'cache' } dovim.env[('XDG_%s_HOME'):format(name:upper())] =root..'/' ..nameend-- bootstrap lazylocallazypath=root..'/plugins/lazy.nvim'ifnotvim.loop.fs_stat(lazypath) thenvim.fn.system {
'git',
'clone',
'--filter=blob:none',
'--single-branch',
'https://github.com/folke/lazy.nvim.git',
lazypath,
}
endvim.opt.runtimepath:prepend(lazypath)
vim.o.foldlevel=99vim.o.foldlevelstart=99-- install pluginslocalplugins= {
{
'nvim-treesitter/nvim-treesitter',
build=':TSUpdate',
event= { 'BufReadPost', 'BufNewFile' },
config=function()
require('nvim-treesitter.configs').setup {
ensure_installed= {
'lua',
},
highlight= {
enable=true,
},
}
end,
},
'ribru17/bamboo.nvim',
'andymass/vim-matchup',
{
'kevinhwang91/nvim-ufo',
dependencies= {
'kevinhwang91/promise-async',
},
opts= {
provider_selector=function(_, _, _)
return { 'treesitter' }
end,
},
},
-- add this to your lua/plugins.lua, lua/plugins/init.lua, or the file you keep your other plugins:
}
require('lazy').setup(plugins, {
root=root..'/plugins',
})
vim.cmd.colorscheme('bamboo')
Additional Context
This bug is not present when folding lines while the cursor is on a closing bracket, only when the cursor is on the first folded line.
Edit: an image example
The text was updated successfully, but these errors were encountered:
Explain the issue
Basically, when using a plugin like nvim-ufo which captures the highlights of a line for the folding text, the
MatchParen
/MatchParenCur
highlight persists in the fold text until the user moves the cursor over the specific corresponding bracket, then moves back off of it.Build type: Release
LuaJIT 2.1.1700008891
Using Tree-sitter vim-matchup
MatchParen
highlight will be cleared upon folding (as it would when moving the cursor)Minimal working example
Please provide a minimal working example, e.g.,
Observe that when folding from the last character of line 1, the fold text keeps the
MatchParen
highlight when the cursor moves anywhere. If folding from line 3, the highlight is also applied initially but disappears properly upon moving the cursor anywhere.Minimal vimrc file
Minimal setup (derived from the lazy.nvim package manager):
Additional Context
This bug is not present when folding lines while the cursor is on a closing bracket, only when the cursor is on the first folded line.
Edit: an image example
The text was updated successfully, but these errors were encountered: