summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-03 19:45:06 +0100
committerBram Moolenaar <Bram@vim.org>2023-06-03 19:45:06 +0100
commitecb87dd7d3f7b9291092a7dd8fae1e59b9903252 (patch)
tree1deda588e0f24488bb553b4a33f93527cff42d8a /src/drawline.c
parent664fd12aa27a3c6bd19cfa474c4630d6c03fcc61 (diff)
patch 9.0.1602: stray character visible if marker on top of double-wide charv9.0.1602
Problem: Stray character is visible if 'smoothscroll' marker is displayed on top of a double-wide character. Solution: When overwriting a double-width character with the 'smoothscroll' marker clear the second half. (closes #12469)
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 2b15f9a3f3..2fbfe452cd 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -823,6 +823,7 @@ wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
&& !(wp->w_p_list && wp->w_lcs_chars.prec != 0))
{
int off = (int)(current_ScreenLine - ScreenLines);
+ int max_off = off + screen_Columns;
int skip = 0;
if (wp->w_p_nu && wp->w_p_rnu)
@@ -836,6 +837,10 @@ wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
for (int i = 0; i < 3 && i + skip < wp->w_width; ++i)
{
+ if ((*mb_off2cells)(off, max_off) > 1)
+ // When the first half of a double-width character is
+ // overwritten, change the second half to a space.
+ ScreenLines[off + 1] = ' ';
ScreenLines[off] = '<';
if (enc_utf8)
ScreenLinesUC[off] = 0;