diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-24 15:28:18 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-24 15:28:18 +0200 |
commit | 4ef18dcc2e3a6a9aea2dc90bbdb742c3c9231394 (patch) | |
tree | ede90dc723e568ac928e7323084aef70217ac515 /src/testdir/test_match.vim | |
parent | d08b8c4c04db9433340df38d21f0e26878f28421 (diff) | |
download | vim-git-4ef18dcc2e3a6a9aea2dc90bbdb742c3c9231394.tar.gz |
patch 8.1.1741: cleared/added match highlighting not updated in other windowv8.1.1741
Problem: Cleared/added match highlighting not updated in other window.
(Andi Massimino)
Solution: Mark the right window for refresh.
Diffstat (limited to 'src/testdir/test_match.vim')
-rw-r--r-- | src/testdir/test_match.vim | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 07005b52f..8eada3fea 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -253,25 +253,54 @@ func Test_matchaddpos_using_negative_priority() set hlsearch& endfunc -func Test_matchdelete_other_window() - if !CanRunVimInTerminal() - throw 'Skipped: cannot make screendumps' - endif - +func OtherWindowCommon() let lines =<< trim END call setline(1, 'Hello Vim world') let mid = matchadd('Error', 'world', 1) let winid = win_getid() new END - call writefile(lines, 'XscriptMatchDelete') - let buf = RunVimInTerminal('-S XscriptMatchDelete', #{rows: 12}) + call writefile(lines, 'XscriptMatchCommon') + let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12}) call term_wait(buf) + return buf +endfunc + +func Test_matchdelete_other_window() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let buf = OtherWindowCommon() call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>") call VerifyScreenDump(buf, 'Test_matchdelete_1', {}) call StopVimInTerminal(buf) - call delete('XscriptMatchDelete') + call delete('XscriptMatchCommon') +endfunc + +func Test_matchclear_other_window() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let buf = OtherWindowCommon() + call term_sendkeys(buf, ":call clearmatches(winid)\<CR>") + call VerifyScreenDump(buf, 'Test_matchclear_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchCommon') +endfunc + +func Test_matchadd_other_window() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let buf = OtherWindowCommon() + call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\<CR>") + call term_sendkeys(buf, ":\<CR>") + call VerifyScreenDump(buf, 'Test_matchadd_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchCommon') endfunc |