diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-03 19:45:06 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-06-03 19:45:06 +0100 |
commit | ecb87dd7d3f7b9291092a7dd8fae1e59b9903252 (patch) | |
tree | 1deda588e0f24488bb553b4a33f93527cff42d8a /src/drawline.c | |
parent | 664fd12aa27a3c6bd19cfa474c4630d6c03fcc61 (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.c | 5 |
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; |