]> granicus.if.org Git - vim/commitdiff
patch 8.0.0987: terminal: second byte of double-byte char wrong v8.0.0987
authorBram Moolenaar <Bram@vim.org>
Tue, 22 Aug 2017 20:29:00 +0000 (22:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 22 Aug 2017 20:29:00 +0000 (22:29 +0200)
Problem:    terminal: second byte of double-byte char wrong
Solution:   Set the second byte to NUL only for utf-8 and non-multibyte.

src/terminal.c
src/version.c

index 3ee50e490f7d3c0b55d186742e500dbe7cc40b6f..1baad7bf1f1a30408b9ed1dbf67385a796422a39 100644 (file)
@@ -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;
                }
index 6baf62be44d02c5f6a79877fbb3cadb543453709..6d2de866330a66ef84a6b350a0bccd6a8b70f55b 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    987,
 /**/
     986,
 /**/