forked from aniani/vim
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:
@@ -237,6 +237,37 @@ func Test_visual_block_scroll()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Test for clearing paren highlight when switching buffers
|
||||
func Test_matchparen_clear_highlight()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim END
|
||||
source $VIMRUNTIME/plugin/matchparen.vim
|
||||
set hidden
|
||||
call setline(1, ['()'])
|
||||
normal 0
|
||||
|
||||
func OtherBuffer()
|
||||
enew
|
||||
exe "normal iaa\<Esc>0"
|
||||
endfunc
|
||||
END
|
||||
call writefile(lines, 'XMatchparenClear', 'D')
|
||||
let buf = RunVimInTerminal('-S XMatchparenClear', #{rows: 5})
|
||||
call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_1', {})
|
||||
|
||||
call term_sendkeys(buf, ":call OtherBuffer()\<CR>:\<Esc>")
|
||||
call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_2', {})
|
||||
|
||||
call term_sendkeys(buf, "\<C-^>:\<Esc>")
|
||||
call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_1', {})
|
||||
|
||||
call term_sendkeys(buf, "\<C-^>:\<Esc>")
|
||||
call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_2', {})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_display_scroll_at_topline()
|
||||
CheckScreendump
|
||||
|
||||
|
||||
Reference in New Issue
Block a user