patch 9.0.0969: matchparen highlight is not updated when switching buffers
Problem: Matchparen highlight is not updated when switching buffers.
Solution: Listen to the BufLeave and the BufWinEnter autocmd events.
(closes #11626)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2021 Apr 08
|
||||
" Last Change: 2022 Nov 28
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
@ -19,8 +19,8 @@ endif
|
||||
|
||||
augroup matchparen
|
||||
" Replace all matchparen autocommands
|
||||
autocmd! CursorMoved,CursorMovedI,WinEnter,WinScrolled * call s:Highlight_Matching_Pair()
|
||||
autocmd! WinLeave * call s:Remove_Matches()
|
||||
autocmd! CursorMoved,CursorMovedI,WinEnter,BufWinEnter,WinScrolled * call s:Highlight_Matching_Pair()
|
||||
autocmd! WinLeave,BufLeave * call s:Remove_Matches()
|
||||
if exists('##TextChanged')
|
||||
autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair()
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user