forked from aniani/vim
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.
This commit is contained in:
@@ -3850,7 +3850,7 @@ match_add(
|
|||||||
prev->next = m;
|
prev->next = m;
|
||||||
m->next = cur;
|
m->next = cur;
|
||||||
|
|
||||||
redraw_later(rtype);
|
redraw_win_later(wp, rtype);
|
||||||
return id;
|
return id;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@@ -3932,7 +3932,7 @@ clear_matches(win_T *wp)
|
|||||||
vim_free(wp->w_match_head);
|
vim_free(wp->w_match_head);
|
||||||
wp->w_match_head = m;
|
wp->w_match_head = m;
|
||||||
}
|
}
|
||||||
redraw_later(SOME_VALID);
|
redraw_win_later(wp, SOME_VALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
12
src/testdir/dumps/Test_matchadd_1.dump
Normal file
12
src/testdir/dumps/Test_matchadd_1.dump
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
> +0&#ffffff0@74
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
|
||||||
|
|H+0&#ffff4012|e|l@1|o| +0&#ffffff0|V|i|m| |w+0#ffffff16#ff404010|o|r|l|d| +0#0000000#ffffff0@59
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
|
||||||
|
|:+0&&| @73
|
12
src/testdir/dumps/Test_matchclear_1.dump
Normal file
12
src/testdir/dumps/Test_matchclear_1.dump
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
> +0&#ffffff0@74
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
|
||||||
|
|H+0&&|e|l@1|o| |V|i|m| |w|o|r|l|d| @59
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
|
||||||
|
|:+0&&|c|a|l@1| |c|l|e|a|r|m|a|t|c|h|e|s|(|w|i|n|i|d|)| @49
|
@@ -253,25 +253,54 @@ func Test_matchaddpos_using_negative_priority()
|
|||||||
set hlsearch&
|
set hlsearch&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_matchdelete_other_window()
|
func OtherWindowCommon()
|
||||||
if !CanRunVimInTerminal()
|
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
call setline(1, 'Hello Vim world')
|
call setline(1, 'Hello Vim world')
|
||||||
let mid = matchadd('Error', 'world', 1)
|
let mid = matchadd('Error', 'world', 1)
|
||||||
let winid = win_getid()
|
let winid = win_getid()
|
||||||
new
|
new
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XscriptMatchDelete')
|
call writefile(lines, 'XscriptMatchCommon')
|
||||||
let buf = RunVimInTerminal('-S XscriptMatchDelete', #{rows: 12})
|
let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12})
|
||||||
call term_wait(buf)
|
call term_wait(buf)
|
||||||
|
return buf
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_matchdelete_other_window()
|
||||||
|
if !CanRunVimInTerminal()
|
||||||
|
throw 'Skipped: cannot make screendumps'
|
||||||
|
endif
|
||||||
|
let buf = OtherWindowCommon()
|
||||||
call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
|
call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
|
||||||
call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
|
call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XscriptMatchDelete')
|
call delete('XscriptMatchCommon')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_matchclear_other_window()
|
||||||
|
if !CanRunVimInTerminal()
|
||||||
|
throw 'Skipped: cannot make screendumps'
|
||||||
|
endif
|
||||||
|
let buf = OtherWindowCommon()
|
||||||
|
call term_sendkeys(buf, ":call clearmatches(winid)\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_matchclear_1', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XscriptMatchCommon')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_matchadd_other_window()
|
||||||
|
if !CanRunVimInTerminal()
|
||||||
|
throw 'Skipped: cannot make screendumps'
|
||||||
|
endif
|
||||||
|
let buf = OtherWindowCommon()
|
||||||
|
call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\<CR>")
|
||||||
|
call term_sendkeys(buf, ":\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_matchadd_1', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XscriptMatchCommon')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
@@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1741,
|
||||||
/**/
|
/**/
|
||||||
1740,
|
1740,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user