Mercurial > vim
diff src/testdir/test_match.vim @ 14407:631344964949 v8.1.0218
patch 8.1.0218: cannot add matches to another window
commit https://github.com/vim/vim/commit/95e51470f10e1ddcc4b2ce53e4f7ff7aa2e58417
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 28 16:55:56 2018 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 28 Jul 2018 17:00:05 +0200 |
parents | 61450cb2b6a1 |
children | 2dcaa860e3fc |
line wrap: on
line diff
--- 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