diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-13 20:06:34 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-13 20:09:02 +0100 |
commit | 21b0a3df8c4abb884489dfcc0c92b1bbe058f291 (patch) | |
tree | e0209637f4f0d58ee48bccf5fe5e2a89ecc763cd /src/drawline.c | |
parent | 760f664213dea9a300454992ba1589f4601d622f (diff) |
patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrapv9.1.0174
Problem: 'cursorline' and 'wincolor' highlight missing with concealed and
wrapped lines.
Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols.
(zeertzjq)
Since 'cursorline' and 'wincolor' highlight apply after the end of the
line, it is more consistent to have them also apply to boguscols.
Assigning MAXCOL to values in ScreenCols[] make mouse click behave the
same with 'cursorline' and 'nocursorline', but such behavior may be
incorrect, as it puts the cursor on the next screen line. That may be
fixed in a future PR.
closes: #14192
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 | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/drawline.c b/src/drawline.c index 629d66f1c2..946e9bd3dd 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -4121,6 +4121,47 @@ win_line( { #ifdef FEAT_CONCEAL wlv.col -= wlv.boguscols; + // Apply 'cursorline' and 'wincolor' highlight. + if (wlv.boguscols != 0 && ( +# ifdef LINE_ATTR + wlv.line_attr != 0 || +# endif + wlv.win_attr != 0 + ) + ) + { + int attr = wlv.win_attr; +# ifdef LINE_ATTR + if (wlv.line_attr != 0) + attr = hl_combine_attr(attr, wlv.line_attr); +# endif + while (( +# ifdef FEAT_RIGHTLEFT + wp->w_p_rl ? wlv.col >= 0 : +# endif + wlv.col < wp->w_width)) + { + ScreenLines[wlv.off] = ' '; + if (enc_utf8) + ScreenLinesUC[wlv.off] = 0; + ScreenAttrs[wlv.off] = attr; + ScreenCols[wlv.off] = MAXCOL; // TODO: this is wrong +# ifdef FEAT_RIGHTLEFT + if (wp->w_p_rl) + { + wlv.off--; + wlv.col--; + wlv.boguscols++; + } + else +# endif + { + wlv.off++; + wlv.col++; + wlv.boguscols--; + } + } + } wlv_screen_line(wp, &wlv, FALSE); wlv.col += wlv.boguscols; wlv.boguscols = 0; |