patch 9.1.0179: 'wincolor' highlight missing with "below" virtual text
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>
diff --git a/src/drawline.c b/src/drawline.c
index 088477f..112dc64 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -812,12 +812,12 @@
*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 @@
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