summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-07-28 16:55:56 +0200
committerBram Moolenaar <Bram@vim.org>2018-07-28 16:55:56 +0200
commit95e51470f10e1ddcc4b2ce53e4f7ff7aa2e58417 (patch)
treed0c487f4376723111aed8d270da21ae3d2b5a57f /src/testdir
parentfd249460fe600dba479bca03058e679bae6b5d52 (diff)
downloadvim-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.vim22
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