Permalink
Browse files

patch 8.0.1168: wrong highlighting with combination of match and 'cur…

…sorline'

Problem:    wrong highlighting with combination of match and 'cursorline'.
Solution:   Use "line_attr" when appropriate. (Ozaki Kiichi, closes #2111)
            But don't highlight more than one character.
  • Loading branch information...
brammool committed Sep 30, 2017
1 parent 3a497e1 commit 0aa398f55a327282c70f56e0bac2dcb9521da378
Showing with 491 additions and 2 deletions.
  1. +13 −1 src/screen.c
  2. +455 −1 src/testdir/test_highlight.vim
  3. +21 −0 src/testdir/view_util.vim
  4. +2 −0 src/version.c
View
@@ -4168,6 +4168,9 @@ win_line(
if (shl != &search_hl && cur != NULL)
cur = cur->next;
}
/* Only highlight one character after the last column. */
if (*ptr == NUL && did_line_attr >= 1)
search_attr = 0;
}
#endif
@@ -5064,7 +5067,9 @@ win_line(
++did_line_attr;
/* don't do search HL for the rest of the line */
if (line_attr != 0 && char_attr == search_attr && col > 0)
if (line_attr != 0 && char_attr == search_attr
&& (did_line_attr > 1
|| (wp->w_p_list && lcs_eol > 0)))
char_attr = line_attr;
# ifdef FEAT_DIFF
if (diff_hlf == HLF_TXD)
@@ -5320,6 +5325,13 @@ win_line(
#ifdef FEAT_SEARCH_EXTRA
/* highlight 'hlsearch' match at end of line */
|| (prevcol_hl_flag == TRUE
# ifdef FEAT_SYN_HL
&& !(wp->w_p_cul && lnum == wp->w_cursor.lnum
&& !(wp == curwin && VIsual_active))
# endif
# ifdef FEAT_DIFF
&& diff_hlf == (hlf_T)0
# endif
# if defined(LINE_ATTR)
&& did_line_attr <= 1
# endif
Oops, something went wrong.

0 comments on commit 0aa398f

Please sign in to comment.