summaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
authormikoto2000 <mikoto2000@gmail.com>2024-04-17 22:06:54 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-17 22:06:54 +0200
commite20fa59903525e15cecd680a2f32ece8a5d1bc0c (patch)
tree3d98c187460597c6d76c28b16faab77723425213 /src/screen.c
parentacdfb8a97995e0f81832207e39564ba795281108 (diff)
patch 9.1.0344: Cursor wrong after using setcellwidth() in terminalv9.1.0344
Problem: Cursor wrong after using setcellwidth() in terminal (mikoto2000) Solution: output additional spaces, so the behaviour matches the GUI (mikoto2000) fixes: #14539 closes: #14540 Signed-off-by: mikoto2000 <mikoto2000@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org> Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 71ddbcaab2..a8b4559b11 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1981,7 +1981,24 @@ screen_char(unsigned off, int row, int col)
{
char_u buf[MB_MAXBYTES + 1];
- if (utf_ambiguous_width(ScreenLinesUC[off]))
+ if (get_cellwidth(ScreenLinesUC[off]) > 1)
+ {
+ // If the width is set to 2 with `setcellwidths`
+
+#ifdef FEAT_GUI
+ if (!gui.in_use)
+ {
+#endif
+ // Clear the two screen cells. If the character is actually
+ // single width it won't change the second cell.
+ out_str((char_u *)" ");
+ term_windgoto(row, col);
+ screen_cur_col = 9999;
+#ifdef FEAT_GUI
+ }
+#endif
+ }
+ else if (utf_ambiguous_width(ScreenLinesUC[off]))
{
if (*p_ambw == 'd'
#ifdef FEAT_GUI