diff src/drawline.c @ 26334:baec4e1cee43 v8.2.3698

patch 8.2.3698: match highlighting continues over breakindent Commit: https://github.com/vim/vim/commit/0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 29 19:18:57 2021 +0000 patch 8.2.3698: match highlighting continues over breakindent Problem: Match highlighting continues over breakindent. Solution: Stop before the end column. (closes https://github.com/vim/vim/issues/9242)
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Nov 2021 20:30:04 +0100
parents 365e7f083f02
children 4cf208415483
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -434,6 +434,7 @@ win_line(
 
 #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA)
     int		match_conc	= 0;	// cchar for match functions
+    int		on_last_col     = FALSE;
 #endif
 #ifdef FEAT_CONCEAL
     int		syntax_flags	= 0;
@@ -1382,7 +1383,8 @@ win_line(
 		v = (long)(ptr - line);
 		search_attr = update_search_hl(wp, lnum, (colnr_T)v, &line,
 				      &screen_search_hl, &has_match_conc,
-				      &match_conc, did_line_attr, lcs_eol_one);
+				      &match_conc, did_line_attr, lcs_eol_one,
+				      &on_last_col);
 		ptr = line + v;  // "line" may have been changed
 
 		// Do not allow a conceal over EOL otherwise EOL will be missed
@@ -2012,6 +2014,10 @@ win_line(
 			if (n_extra < 0)
 			    n_extra = 0;
 		    }
+		    if (on_last_col)
+			// Do not continue search/match highlighting over the
+			// line break.
+			search_attr = 0;
 
 		    if (c == TAB && n_extra + col > wp->w_width)
 # ifdef FEAT_VARTABS