forked from aniani/vim
patch 8.1.1739: deleted match highlighting not updated in other window
Problem: Deleted match highlighting not updated in other window. Solution: Mark the window for refresh. (closes #4720) Also fix that ambi-width check clears with wrong attributes.
This commit is contained in:
@@ -3912,7 +3912,7 @@ match_delete(win_T *wp, int id, int perr)
|
|||||||
rtype = VALID;
|
rtype = VALID;
|
||||||
}
|
}
|
||||||
vim_free(cur);
|
vim_free(cur);
|
||||||
redraw_later(rtype);
|
redraw_win_later(wp, rtype);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3718,6 +3718,7 @@ may_req_ambiguous_char_width(void)
|
|||||||
|
|
||||||
/* This overwrites a few characters on the screen, a redraw is needed
|
/* This overwrites a few characters on the screen, a redraw is needed
|
||||||
* after this. Clear them out for now. */
|
* after this. Clear them out for now. */
|
||||||
|
screen_stop_highlight();
|
||||||
term_windgoto(1, 0);
|
term_windgoto(1, 0);
|
||||||
out_str((char_u *)" ");
|
out_str((char_u *)" ");
|
||||||
term_windgoto(0, 0);
|
term_windgoto(0, 0);
|
||||||
|
12
src/testdir/dumps/Test_matchdelete_1.dump
Normal file
12
src/testdir/dumps/Test_matchdelete_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| |m|a|t|c|h|d|e|l|e|t|e|(|m|i|d|,| |w|i|n|i|d|)| @45
|
@@ -1,6 +1,8 @@
|
|||||||
" Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(),
|
" Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(),
|
||||||
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
|
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
|
||||||
|
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
function Test_match()
|
function Test_match()
|
||||||
highlight MyGroup1 term=bold ctermbg=red guibg=red
|
highlight MyGroup1 term=bold ctermbg=red guibg=red
|
||||||
highlight MyGroup2 term=italic ctermbg=green guibg=green
|
highlight MyGroup2 term=italic ctermbg=green guibg=green
|
||||||
@@ -251,4 +253,26 @@ func Test_matchaddpos_using_negative_priority()
|
|||||||
set hlsearch&
|
set hlsearch&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_matchdelete_other_window()
|
||||||
|
if !CanRunVimInTerminal()
|
||||||
|
throw 'Skipped: cannot make screendumps'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
call setline(1, 'Hello Vim world')
|
||||||
|
let mid = matchadd('Error', 'world', 1)
|
||||||
|
let winid = win_getid()
|
||||||
|
new
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XscriptMatchDelete')
|
||||||
|
let buf = RunVimInTerminal('-S XscriptMatchDelete', #{rows: 12})
|
||||||
|
call term_wait(buf)
|
||||||
|
call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XscriptMatchDelete')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
1739,
|
||||||
/**/
|
/**/
|
||||||
1738,
|
1738,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user