Mercurial > vim
diff src/drawline.c @ 32541:75e56c94316d v9.0.1602
patch 9.0.1602: stray character visible if marker on top of double-wide char
Commit: https://github.com/vim/vim/commit/ecb87dd7d3f7b9291092a7dd8fae1e59b9903252
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sat Jun 3 19:45:06 2023 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 03 Jun 2023 21:00:04 +0200 |
parents | 2a672d04c547 |
children | cceee401aa51 |
line wrap: on
line diff
--- a/src/drawline.c +++ b/src/drawline.c @@ -823,6 +823,7 @@ wlv_screen_line(win_T *wp, winlinevars_T && !(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 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;