comparison src/testdir/test_display.vim @ 31271:985a3d6e1d4b v9.0.0969

patch 9.0.0969: matchparen highlight is not updated when switching buffers Commit: https://github.com/vim/vim/commit/28a896f54d4b2f2b4bef8ef4144dde1673c9d6e7 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 28 22:21:12 2022 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Nov 2022 23:30:03 +0100
parents f784ea65b258
children d98bc6992945
comparison
equal deleted inserted replaced
31270:8f50da4cfb18 31271:985a3d6e1d4b
231 231
232 let buf = RunVimInTerminal('-S '.filename, #{rows: 7}) 232 let buf = RunVimInTerminal('-S '.filename, #{rows: 7})
233 call term_sendkeys(buf, "V\<C-D>\<C-D>") 233 call term_sendkeys(buf, "V\<C-D>\<C-D>")
234 234
235 call VerifyScreenDump(buf, 'Test_display_visual_block_scroll', {}) 235 call VerifyScreenDump(buf, 'Test_display_visual_block_scroll', {})
236
237 call StopVimInTerminal(buf)
238 endfunc
239
240 " Test for clearing paren highlight when switching buffers
241 func Test_matchparen_clear_highlight()
242 CheckScreendump
243
244 let lines =<< trim END
245 source $VIMRUNTIME/plugin/matchparen.vim
246 set hidden
247 call setline(1, ['()'])
248 normal 0
249
250 func OtherBuffer()
251 enew
252 exe "normal iaa\<Esc>0"
253 endfunc
254 END
255 call writefile(lines, 'XMatchparenClear', 'D')
256 let buf = RunVimInTerminal('-S XMatchparenClear', #{rows: 5})
257 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_1', {})
258
259 call term_sendkeys(buf, ":call OtherBuffer()\<CR>:\<Esc>")
260 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_2', {})
261
262 call term_sendkeys(buf, "\<C-^>:\<Esc>")
263 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_1', {})
264
265 call term_sendkeys(buf, "\<C-^>:\<Esc>")
266 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_2', {})
236 267
237 call StopVimInTerminal(buf) 268 call StopVimInTerminal(buf)
238 endfunc 269 endfunc
239 270
240 func Test_display_scroll_at_topline() 271 func Test_display_scroll_at_topline()