diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-28 16:55:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-28 16:55:56 +0200 |
commit | 95e51470f10e1ddcc4b2ce53e4f7ff7aa2e58417 (patch) | |
tree | d0c487f4376723111aed8d270da21ae3d2b5a57f /src/testdir | |
parent | fd249460fe600dba479bca03058e679bae6b5d52 (diff) | |
download | vim-git-95e51470f10e1ddcc4b2ce53e4f7ff7aa2e58417.tar.gz |
patch 8.1.0218: cannot add matches to another windowv8.1.0218
Problem: Cannot add matches to another window. (Qiming Zhao)
Solution: Add the "window" argument to matchadd() and matchaddpos().
(closes #3260)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_match.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 28dd97c92..70f049099 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -192,6 +192,28 @@ func Test_matchaddpos() set hlsearch& endfunc +func Test_matchaddpos_otherwin() + syntax on + new + call setline(1, ['12345', 'NP']) + let winid = win_getid() + + wincmd w + call matchadd('Search', '4', 10, -1, {'window': winid}) + call matchaddpos('Error', [[1,2], [2,2]], 10, -1, {'window': winid}) + redraw! + call assert_notequal(screenattr(1,2), 0) + call assert_notequal(screenattr(1,4), 0) + call assert_notequal(screenattr(2,2), 0) + call assert_equal(screenattr(1,2), screenattr(2,2)) + call assert_notequal(screenattr(1,2), screenattr(1,4)) + + wincmd w + bwipe! + call clearmatches() + syntax off +endfunc + func Test_matchaddpos_using_negative_priority() set hlsearch |