Mercurial > vim
comparison src/testdir/test_match.vim @ 17486:bdf277d2d14c v8.1.1741
patch 8.1.1741: cleared/added match highlighting not updated in other window
commit https://github.com/vim/vim/commit/4ef18dcc2e3a6a9aea2dc90bbdb742c3c9231394
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 24 15:28:18 2019 +0200
patch 8.1.1741: cleared/added match highlighting not updated in other window
Problem: Cleared/added match highlighting not updated in other window.
(Andi Massimino)
Solution: Mark the right window for refresh.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 24 Jul 2019 15:30:06 +0200 |
parents | 6cf077f59152 |
children | 0da9bc55c31a |
comparison
equal
deleted
inserted
replaced
17485:356e91a3833a | 17486:bdf277d2d14c |
---|---|
251 | 251 |
252 nohl | 252 nohl |
253 set hlsearch& | 253 set hlsearch& |
254 endfunc | 254 endfunc |
255 | 255 |
256 func Test_matchdelete_other_window() | 256 func OtherWindowCommon() |
257 if !CanRunVimInTerminal() | |
258 throw 'Skipped: cannot make screendumps' | |
259 endif | |
260 | |
261 let lines =<< trim END | 257 let lines =<< trim END |
262 call setline(1, 'Hello Vim world') | 258 call setline(1, 'Hello Vim world') |
263 let mid = matchadd('Error', 'world', 1) | 259 let mid = matchadd('Error', 'world', 1) |
264 let winid = win_getid() | 260 let winid = win_getid() |
265 new | 261 new |
266 END | 262 END |
267 call writefile(lines, 'XscriptMatchDelete') | 263 call writefile(lines, 'XscriptMatchCommon') |
268 let buf = RunVimInTerminal('-S XscriptMatchDelete', #{rows: 12}) | 264 let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12}) |
269 call term_wait(buf) | 265 call term_wait(buf) |
266 return buf | |
267 endfunc | |
268 | |
269 func Test_matchdelete_other_window() | |
270 if !CanRunVimInTerminal() | |
271 throw 'Skipped: cannot make screendumps' | |
272 endif | |
273 let buf = OtherWindowCommon() | |
270 call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>") | 274 call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>") |
271 call VerifyScreenDump(buf, 'Test_matchdelete_1', {}) | 275 call VerifyScreenDump(buf, 'Test_matchdelete_1', {}) |
272 | 276 |
273 call StopVimInTerminal(buf) | 277 call StopVimInTerminal(buf) |
274 call delete('XscriptMatchDelete') | 278 call delete('XscriptMatchCommon') |
279 endfunc | |
280 | |
281 func Test_matchclear_other_window() | |
282 if !CanRunVimInTerminal() | |
283 throw 'Skipped: cannot make screendumps' | |
284 endif | |
285 let buf = OtherWindowCommon() | |
286 call term_sendkeys(buf, ":call clearmatches(winid)\<CR>") | |
287 call VerifyScreenDump(buf, 'Test_matchclear_1', {}) | |
288 | |
289 call StopVimInTerminal(buf) | |
290 call delete('XscriptMatchCommon') | |
291 endfunc | |
292 | |
293 func Test_matchadd_other_window() | |
294 if !CanRunVimInTerminal() | |
295 throw 'Skipped: cannot make screendumps' | |
296 endif | |
297 let buf = OtherWindowCommon() | |
298 call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\<CR>") | |
299 call term_sendkeys(buf, ":\<CR>") | |
300 call VerifyScreenDump(buf, 'Test_matchadd_1', {}) | |
301 | |
302 call StopVimInTerminal(buf) | |
303 call delete('XscriptMatchCommon') | |
275 endfunc | 304 endfunc |
276 | 305 |
277 | 306 |
278 " vim: shiftwidth=2 sts=2 expandtab | 307 " vim: shiftwidth=2 sts=2 expandtab |