summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-22 22:29:00 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-22 22:29:00 +0200
commitd2c45a1964ddb0d9ac16c9c985051fab41f37840 (patch)
tree9d84b99f83994233aaa0e3895b55487b2b27a0f1
parentec0e07a32484ab70f1c7668294c3d8d67f8aca82 (diff)
downloadvim-git-d2c45a1964ddb0d9ac16c9c985051fab41f37840.tar.gz
patch 8.0.0987: terminal: second byte of double-byte char wrongv8.0.0987
Problem: terminal: second byte of double-byte char wrong Solution: Set the second byte to NUL only for utf-8 and non-multibyte.
-rw-r--r--src/terminal.c8
-rw-r--r--src/version.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 3ee50e490..1baad7bf1 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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;
}
diff --git a/src/version.c b/src/version.c
index 6baf62be4..6d2de8663 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 987,
+/**/
986,
/**/
985,