From d7d69fed18c2cd59d28ff12ef72f6fb2a98a7b66 Mon Sep 17 00:00:00 2001 From: Shougo Date: Sat, 16 May 2020 22:25:51 +0900 Subject: vim-patch:8.1.1084: cannot delete a match from another window (#12325) Problem: Cannot delete a match from another window. (Paul Jolly) Solution: Add window ID argument to matchdelete(), clearmatches(), getmatches() and setmatches(). (Andy Massimino, closes vim/vim#4178) https://github.com/vim/vim/commit/aff749145e23c0f20b5158d1d3a942948ed138e3 --- src/nvim/testdir/test_match.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index c134cfb1c0..7a1894bc16 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -217,6 +217,19 @@ func Test_matchaddpos_otherwin() call assert_equal(screenattr(1,2), screenattr(2,2)) call assert_notequal(screenattr(1,2), screenattr(1,4)) + let savematches = getmatches(winid) + let expect = [ + \ {'group': 'Search', 'pattern': '4', 'priority': 10, 'id': 4}, + \ {'group': 'Error', 'id': 5, 'priority': 10, 'pos1': [1, 2, 1], 'pos2': [2, 2, 1]}, + \] + call assert_equal(expect, savematches) + + call clearmatches(winid) + call assert_equal([], getmatches(winid)) + + call setmatches(savematches, winid) + call assert_equal(expect, savematches) + wincmd w bwipe! call clearmatches() -- cgit