summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2023-08-19 15:35:04 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-19 15:35:04 +0200
commitdbeadf05b6a152e7d9c5cc23d9202057f8e99884 (patch)
treec5077787ac0084ad3027075e402ced73af7b931d /src/drawline.c
parent6d192a4ac9ba600ec28eb86d2cc45dea67f5922b (diff)
patch 9.0.1749: Text property highlight doesn't override a sign highlight on TABv9.0.1749
Problem: Text property highlight doesn't override a sign highlight over a tab character Solution: Let text_property override tab highlighting This fixes a few problems of text properties: - text property highlighting when override=true does not overwrite TAB highlighting - text property highlighting when override=true does not overwrite TAB highlighting with :set list - text property highlighting is used instead of sign highlight after the actual text ends when signs are present with linehl is set closes: #21584 closes: #21592 Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 99994d64c0..e3084d4c57 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -2009,7 +2009,13 @@ win_line(
++text_prop_next;
}
- if (wlv.n_extra == 0 || !wlv.extra_for_textprop)
+ if (wlv.n_extra == 0 ||
+ (!wlv.extra_for_textprop
+#ifdef FEAT_PROP_POPUP
+ && !(text_prop_type != NULL &&
+ text_prop_flags & PT_FLAG_OVERRIDE)
+#endif
+ ))
{
text_prop_attr = 0;
text_prop_attr_comb = 0;
@@ -3278,6 +3284,12 @@ win_line(
n_attr = wlv.n_extra + 1;
wlv.extra_attr = hl_combine_attr(wlv.win_attr,
HL_ATTR(HLF_8));
+#ifdef FEAT_PROP_POPUP
+ if (text_prop_type != NULL &&
+ text_prop_flags & PT_FLAG_OVERRIDE)
+ wlv.extra_attr = hl_combine_attr(text_prop_attr, wlv.extra_attr);
+#endif
+
saved_attr2 = wlv.char_attr; // save current attr
}
mb_utf8 = FALSE; // don't draw as UTF-8
@@ -3329,6 +3341,11 @@ win_line(
|| (wp->w_p_list &&
wp->w_lcs_chars.eol > 0)))
wlv.char_attr = wlv.line_attr;
+#ifdef FEAT_SIGNS
+ // At end of line: if Sign is present with line highlight, reset char_attr
+ if (sign_present && wlv.sattr.sat_linehl > 0 && wlv.draw_state == WL_LINE)
+ wlv.char_attr = wlv.sattr.sat_linehl;
+#endif
# ifdef FEAT_DIFF
if (wlv.diff_hlf == HLF_TXD)
{