diff src/testdir/test_match.vim @ 16158:aef0f93d3eba v8.1.1084

patch 8.1.1084: cannot delete a match from another window commit https://github.com/vim/vim/commit/aff749145e23c0f20b5158d1d3a942948ed138e3 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 30 18:11:49 2019 +0100 patch 8.1.1084: cannot delete a match from another window Problem: Cannot delete a match from another window. (Paul Jolly) Solution: Add window ID argument to matchdelete(), clearmatches(), getmatches() and setmatches(). (Andy Massimino, closes #4178)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Mar 2019 18:15:05 +0100
parents 2dcaa860e3fc
children 6cf077f59152
line wrap: on
line diff
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -205,6 +205,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()