diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/drawline.c | 5 | ||||
-rw-r--r-- | src/nvim/testdir/test_match.vim | 18 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index b926f2da83..f0637549f7 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1844,9 +1844,10 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, n_extra = 0; } } - if (on_last_col) { + if (on_last_col && c != TAB) { // 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; } diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index 3c63314253..600b6132a9 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -421,4 +421,22 @@ func Test_matchdelete_redraw() bw! 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 |