diff src/screen.c @ 12580:ba55861aa52c v8.0.1168

patch 8.0.1168: wrong highlighting with combination of match and 'cursorline' commit https://github.com/vim/vim/commit/0aa398f55a327282c70f56e0bac2dcb9521da378 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 30 21:23:55 2017 +0200 patch 8.0.1168: wrong highlighting with combination of match and 'cursorline' Problem: wrong highlighting with combination of match and 'cursorline'. Solution: Use "line_attr" when appropriate. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/2111) But don't highlight more than one character.
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Sep 2017 21:30:05 +0200
parents 158917d728b4
children 97f0c74976c6
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -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