diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-14 18:16:56 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-14 18:16:56 +0100 |
commit | 9352c282928f6cb25060249c157a28803c6efa9d (patch) | |
tree | 55dd90efca27d18b07089815c19b368d8b118efb /src/drawline.c | |
parent | 45da32964d6e7e635af8fcf0b42e974b0b536ed3 (diff) |
patch 9.1.0179: 'wincolor' highlight missing with "below" virtual textv9.1.0179
Problem: 'wincolor' highlight missing with "below" virtual text.
Solution: Subtract n_attr_skip from n_attr. Combine 'wincolor' with
other highlights when 'nowrap' is set. (zeertzjq)
closes: #14196
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/drawline.c')
-rw-r--r-- | src/drawline.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/drawline.c b/src/drawline.c index 088477faf0..112dc6466a 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -812,12 +812,12 @@ text_prop_position( *p_extra = l; *n_extra = n_used + before + after + padding; *n_attr = mb_charlen(*p_extra); - if (above) - *n_attr -= padding + after; - // n_attr_skip will not be decremented before draw_state is // WL_LINE *n_attr_skip = before + (padding > 0 ? padding : 0); + *n_attr -= *n_attr_skip; + if (above) + *n_attr -= after; } } } @@ -946,14 +946,15 @@ draw_screen_line(win_T *wp, winlinevars_T *wlv) VCOL_HLC, &wlv->color_cols); int attr = wlv->win_attr; - if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol) - attr = HL_ATTR(HLF_CUC); - else if (wlv->draw_color_col && VCOL_HLC == *wlv->color_cols) - attr = HL_ATTR(HLF_MC); # ifdef LINE_ATTR - else if (wlv->line_attr != 0) - attr = wlv->line_attr; + if (wlv->line_attr != 0) + attr = hl_combine_attr(attr, wlv->line_attr); # endif + if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol + && wlv->lnum != wp->w_cursor.lnum) + attr = hl_combine_attr(attr, HL_ATTR(HLF_CUC)); + else if (wlv->draw_color_col && VCOL_HLC == *wlv->color_cols) + attr = hl_combine_attr(attr, HL_ATTR(HLF_MC)); ScreenAttrs[wlv->off++] = attr; if (VCOL_HLC >= rightmost_vcol |