From dbeadf05b6a152e7d9c5cc23d9202057f8e99884 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 19 Aug 2023 15:35:04 +0200 Subject: patch 9.0.1749: Text property highlight doesn't override a sign highlight on TAB 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 --- src/drawline.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/drawline.c') 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) { -- cgit v1.2.3