diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2024-11-04 21:54:34 +0100 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2024-11-05 08:31:19 +0100 |
| commit | baf74ef9755e19781f52c3884023321c0198a3b5 (patch) | |
| tree | 8525e210aceaec222ca8b9631b9446714a5a74db /runtime/plugin | |
| parent | fc8e786dae255b8ed63f57e4ae2cd85addbee7b9 (diff) | |
| download | rneovim-baf74ef9755e19781f52c3884023321c0198a3b5.tar.gz rneovim-baf74ef9755e19781f52c3884023321c0198a3b5.tar.bz2 rneovim-baf74ef9755e19781f52c3884023321c0198a3b5.zip | |
vim-patch:59834ba: runtime(matchparen): Add matchparen_disable_cursor_hl config option
Set the "matchparen_disable_cursor_hl" config variable to disable
highlighting the cursor with the MatchParen highlighting group.
closes: vim/vim#15984
https://github.com/vim/vim/commit/59834ba6df10dc48565bf55ac6c8e8a4aa40210b
Co-authored-by: Matteo Landi <matteo@matteolandi.net>
Diffstat (limited to 'runtime/plugin')
| -rw-r--r-- | runtime/plugin/matchparen.vim | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 2899612dce..661a34b578 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -17,6 +17,9 @@ endif if !exists("g:matchparen_insert_timeout") let g:matchparen_insert_timeout = 60 endif +if !exists("g:matchparen_disable_cursor_hl") + let g:matchparen_disable_cursor_hl = 0 +endif let s:has_matchaddpos = exists('*matchaddpos') @@ -189,10 +192,18 @@ func s:Highlight_Matching_Pair() " If a match is found setup match highlighting. if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom if s:has_matchaddpos - call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10)) + if !g:matchparen_disable_cursor_hl + call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10)) + else + call add(w:matchparen_ids, matchaddpos('MatchParen', [[m_lnum, m_col]], 10)) + endif else - exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . - \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + if !g:matchparen_disable_cursor_hl + exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . + \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + else + exe '3match MatchParen /\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + endif call add(w:matchparen_ids, 3) endif let w:paren_hl_on = 1 |