Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
16157:0062198dc347 | 16158:aef0f93d3eba |
---|---|
203 call assert_notequal(screenattr(1,4), 0) | 203 call assert_notequal(screenattr(1,4), 0) |
204 call assert_notequal(screenattr(2,2), 0) | 204 call assert_notequal(screenattr(2,2), 0) |
205 call assert_equal(screenattr(1,2), screenattr(2,2)) | 205 call assert_equal(screenattr(1,2), screenattr(2,2)) |
206 call assert_notequal(screenattr(1,2), screenattr(1,4)) | 206 call assert_notequal(screenattr(1,2), screenattr(1,4)) |
207 | 207 |
208 let savematches = getmatches(winid) | |
209 let expect = [ | |
210 \ {'group': 'Search', 'pattern': '4', 'priority': 10, 'id': 4}, | |
211 \ {'group': 'Error', 'id': 5, 'priority': 10, 'pos1': [1, 2, 1], 'pos2': [2, 2, 1]}, | |
212 \] | |
213 call assert_equal(expect, savematches) | |
214 | |
215 call clearmatches(winid) | |
216 call assert_equal([], getmatches(winid)) | |
217 | |
218 call setmatches(savematches, winid) | |
219 call assert_equal(expect, savematches) | |
220 | |
208 wincmd w | 221 wincmd w |
209 bwipe! | 222 bwipe! |
210 call clearmatches() | 223 call clearmatches() |
211 syntax off | 224 syntax off |
212 endfunc | 225 endfunc |