diff src/drawline.c @ 30233:8d660a45299f v9.0.0452

patch 9.0.0452: Visual highlighting extends into virtual text prop Commit: https://github.com/vim/vim/commit/6eda17d881c9b2880ccb2a4d11951939a58f233d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 12 19:25:11 2022 +0100 patch 9.0.0452: Visual highlighting extends into virtual text prop Problem: Visual highlighting extends into virtual text prop. Solution: Do not highlight what isn't actually selected. Fix ordering of stored text props.
author Bram Moolenaar <Bram@vim.org>
date Mon, 12 Sep 2022 20:30:06 +0200
parents 0d084880276a
children 5f112a0b4da1
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -670,6 +670,7 @@ win_line(
     int		text_prop_follows = FALSE;  // another text prop to display
     int		saved_search_attr = 0;	// search_attr to be used when n_extra
 					// goes to zero
+    int		saved_area_attr = 0;	// idem for area_attr
 #endif
 #ifdef FEAT_SPELL
     int		has_spell = FALSE;	// this buffer has spell checking
@@ -1846,8 +1847,12 @@ win_line(
 			    extra_for_textprop = TRUE;
 			    extra_attr = used_attr;
 			    n_attr = mb_charlen(p);
+			    // restore search_attr and area_attr when n_extra
+			    // is down to zero
 			    saved_search_attr = search_attr;
-			    search_attr = 0;	// restore when n_extra is zero
+			    saved_area_attr = area_attr;
+			    search_attr = 0;
+			    area_attr = 0;
 			    text_prop_attr = 0;
 			    text_prop_attr_comb = 0;
 			    if (*ptr == NUL)
@@ -2203,6 +2208,8 @@ win_line(
 		in_linebreak = FALSE;
 		if (search_attr == 0)
 		    search_attr = saved_search_attr;
+		if (area_attr == 0 && *ptr != NUL)
+		    area_attr = saved_area_attr;
 	    }
 #endif
 	}