forked from aniani/vim
patch 8.2.4062: match highlighting of tab too short
Problem: Match highlighting of tab too short. Solution: Do not stop match highlighting if on a Tab. (Christian Brabandt, closes #9507, closes #9500)
This commit is contained in:
@@ -2043,9 +2043,10 @@ win_line(
|
|||||||
if (n_extra < 0)
|
if (n_extra < 0)
|
||||||
n_extra = 0;
|
n_extra = 0;
|
||||||
}
|
}
|
||||||
if (on_last_col)
|
if (on_last_col && c != TAB)
|
||||||
// Do not continue search/match highlighting over the
|
// Do not continue search/match highlighting over the
|
||||||
// line break.
|
// line break, but for TABs the highlighting should
|
||||||
|
// include the complete width of the character
|
||||||
search_attr = 0;
|
search_attr = 0;
|
||||||
|
|
||||||
if (c == TAB && n_extra + col > wp->w_width)
|
if (c == TAB && n_extra + col > wp->w_width)
|
||||||
|
10
src/testdir/dumps/Test_match_tab_linebreak.dump
Normal file
10
src/testdir/dumps/Test_match_tab_linebreak.dump
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
| +0#ffffff16#e000002@6> |i+0#0000000#ffffff0|x| @64
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
| +0#0000000&@56|1|,|1|-|8| @8|A|l@1|
|
@@ -407,4 +407,22 @@ func Test_matchdelete_redraw()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_match_tab_with_linebreak()
|
||||||
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
set linebreak
|
||||||
|
call setline(1, "\tix")
|
||||||
|
call matchadd('ErrorMsg', '\t')
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XscriptMatchTabLinebreak')
|
||||||
|
let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
|
||||||
|
call TermWait(buf)
|
||||||
|
call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('XscriptMatchTabLinebreak')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -750,6 +750,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 */
|
||||||
|
/**/
|
||||||
|
4062,
|
||||||
/**/
|
/**/
|
||||||
4061,
|
4061,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user