Permalink
Browse files

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.
  • Loading branch information...
brammool committed Aug 22, 2017
1 parent ec0e07a commit d2c45a1964ddb0d9ac16c9c985051fab41f37840
Showing with 8 additions and 2 deletions.
  1. +6 −2 src/terminal.c
  2. +2 −0 src/version.c
View
@@ -2130,7 +2130,7 @@ term_update_window(win_T *wp)
(char*)mb, 2, 0, 0) > 1)
{
ScreenLines[off] = mb[0];
ScreenLines[off+1] = mb[1];
ScreenLines[off + 1] = mb[1];
cell.width = mb_ptr2cells(mb);
}
else
@@ -2148,8 +2148,12 @@ term_update_window(win_T *wp)
{
if (enc_utf8)
ScreenLinesUC[off] = NUL;
else if (!has_mbyte)
/* don't set the second byte to NUL for a DBCS encoding, it
* has been set above */
if (enc_utf8 || !has_mbyte)
ScreenLines[off] = NUL;
++pos.col;
++off;
}
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
987,
/**/
986,
/**/

0 comments on commit d2c45a1

Please sign in to comment.