From 95e51470f10e1ddcc4b2ce53e4f7ff7aa2e58417 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 16:55:56 +0200 Subject: patch 8.1.0218: cannot add matches to another window Problem: Cannot add matches to another window. (Qiming Zhao) Solution: Add the "window" argument to matchadd() and matchaddpos(). (closes #3260) --- src/testdir/test_match.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/testdir') 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 -- cgit v1.2.1