Skip to content

Commit d2c45a1

Browse files
committed
patch 8.0.0987: terminal: second byte of double-byte char wrong
Problem: terminal: second byte of double-byte char wrong Solution: Set the second byte to NUL only for utf-8 and non-multibyte.
1 parent ec0e07a commit d2c45a1

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/terminal.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,7 +2130,7 @@ term_update_window(win_T *wp)
21302130
(char*)mb, 2, 0, 0) > 1)
21312131
{
21322132
ScreenLines[off] = mb[0];
2133-
ScreenLines[off+1] = mb[1];
2133+
ScreenLines[off + 1] = mb[1];
21342134
cell.width = mb_ptr2cells(mb);
21352135
}
21362136
else
@@ -2148,8 +2148,12 @@ term_update_window(win_T *wp)
21482148
{
21492149
if (enc_utf8)
21502150
ScreenLinesUC[off] = NUL;
2151-
else if (!has_mbyte)
2151+
2152+
/* don't set the second byte to NUL for a DBCS encoding, it
2153+
* has been set above */
2154+
if (enc_utf8 || !has_mbyte)
21522155
ScreenLines[off] = NUL;
2156+
21532157
++pos.col;
21542158
++off;
21552159
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
987,
772774
/**/
773775
986,
774776
/**/

0 commit comments

Comments
 (0)