patch 9.0.1602: stray character visible if marker on top of double-wide char
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)
diff --git a/src/drawline.c b/src/drawline.c
index 2b15f9a..2fbfe45 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -823,6 +823,7 @@
&& !(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 @@
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;