Skip to content

Commit d068670

Browse files
committed
Fix display of 2-cells emoji
1 parent 7dcdb0e commit d068670

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/screen.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8380,7 +8380,13 @@ screen_char(unsigned off, int row, int col)
83808380
{
83818381
char_u buf[MB_MAXBYTES + 1];
83828382

8383-
if (utf_ambiguous_width(ScreenLinesUC[off]))
8383+
if (utf_ambiguous_width(ScreenLinesUC[off])
8384+
# ifdef FEAT_GUI_MACVIM
8385+
/* In the GUI, check if the cell width is actually 1 in order
8386+
* to display 2-cells emoji correctly. */
8387+
&& (!gui.in_use || utf_char2cells(ScreenLinesUC[off]) == 1)
8388+
# endif
8389+
)
83848390
{
83858391
if (*p_ambw == 'd'
83868392
# ifdef FEAT_GUI
@@ -8396,9 +8402,9 @@ screen_char(unsigned off, int row, int col)
83968402
/* not sure where the cursor is after drawing the ambiguous width
83978403
* character */
83988404
# ifdef FEAT_GUI_MACVIM
8399-
if (*p_ambw == 'd' || !gui.in_use)
8405+
if (*p_ambw == 'd' || !gui.in_use)
84008406
# endif
8401-
screen_cur_col = 9999;
8407+
screen_cur_col = 9999;
84028408
}
84038409
else if (utf_char2cells(ScreenLinesUC[off]) > 1)
84048410
++screen_cur_col;

0 commit comments

Comments
 (0)