comparison src/drawline.c @ 32881:ec310fcd2d12 v9.0.1749

patch 9.0.1749: Text property highlight doesn't override a sign highlight on TAB Commit: https://github.com/vim/vim/commit/dbeadf05b6a152e7d9c5cc23d9202057f8e99884 Author: Christian Brabandt <cb@256bit.org> Date: Sat Aug 19 15:35:04 2023 +0200 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 <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Aug 2023 15:45:03 +0200
parents eaf22d1df3c1
children 5c72cda80e1c
comparison
equal deleted inserted replaced
32880:5233502e3ed2 32881:ec310fcd2d12
2007 + text_props[text_prop_next].tp_len) 2007 + text_props[text_prop_next].tp_len)
2008 text_prop_idxs[text_props_active++] = text_prop_next; 2008 text_prop_idxs[text_props_active++] = text_prop_next;
2009 ++text_prop_next; 2009 ++text_prop_next;
2010 } 2010 }
2011 2011
2012 if (wlv.n_extra == 0 || !wlv.extra_for_textprop) 2012 if (wlv.n_extra == 0 ||
2013 (!wlv.extra_for_textprop
2014 #ifdef FEAT_PROP_POPUP
2015 && !(text_prop_type != NULL &&
2016 text_prop_flags & PT_FLAG_OVERRIDE)
2017 #endif
2018 ))
2013 { 2019 {
2014 text_prop_attr = 0; 2020 text_prop_attr = 0;
2015 text_prop_attr_comb = 0; 2021 text_prop_attr_comb = 0;
2016 text_prop_flags = 0; 2022 text_prop_flags = 0;
2017 text_prop_type = NULL; 2023 text_prop_type = NULL;
3276 if (!attr_pri) 3282 if (!attr_pri)
3277 { 3283 {
3278 n_attr = wlv.n_extra + 1; 3284 n_attr = wlv.n_extra + 1;
3279 wlv.extra_attr = hl_combine_attr(wlv.win_attr, 3285 wlv.extra_attr = hl_combine_attr(wlv.win_attr,
3280 HL_ATTR(HLF_8)); 3286 HL_ATTR(HLF_8));
3287 #ifdef FEAT_PROP_POPUP
3288 if (text_prop_type != NULL &&
3289 text_prop_flags & PT_FLAG_OVERRIDE)
3290 wlv.extra_attr = hl_combine_attr(text_prop_attr, wlv.extra_attr);
3291 #endif
3292
3281 saved_attr2 = wlv.char_attr; // save current attr 3293 saved_attr2 = wlv.char_attr; // save current attr
3282 } 3294 }
3283 mb_utf8 = FALSE; // don't draw as UTF-8 3295 mb_utf8 = FALSE; // don't draw as UTF-8
3284 } 3296 }
3285 else if (VIsual_active 3297 else if (VIsual_active
3327 if (wlv.line_attr != 0 && wlv.char_attr == search_attr 3339 if (wlv.line_attr != 0 && wlv.char_attr == search_attr
3328 && (did_line_attr > 1 3340 && (did_line_attr > 1
3329 || (wp->w_p_list && 3341 || (wp->w_p_list &&
3330 wp->w_lcs_chars.eol > 0))) 3342 wp->w_lcs_chars.eol > 0)))
3331 wlv.char_attr = wlv.line_attr; 3343 wlv.char_attr = wlv.line_attr;
3344 #ifdef FEAT_SIGNS
3345 // At end of line: if Sign is present with line highlight, reset char_attr
3346 if (sign_present && wlv.sattr.sat_linehl > 0 && wlv.draw_state == WL_LINE)
3347 wlv.char_attr = wlv.sattr.sat_linehl;
3348 #endif
3332 # ifdef FEAT_DIFF 3349 # ifdef FEAT_DIFF
3333 if (wlv.diff_hlf == HLF_TXD) 3350 if (wlv.diff_hlf == HLF_TXD)
3334 { 3351 {
3335 wlv.diff_hlf = HLF_CHD; 3352 wlv.diff_hlf = HLF_CHD;
3336 if (vi_attr == 0 || wlv.char_attr != vi_attr) 3353 if (vi_attr == 0 || wlv.char_attr != vi_attr)