]> granicus.if.org Git - vim/commitdiff
patch 8.0.1632: in a terminal dump NUL and space are different v8.0.1632
authorBram Moolenaar <Bram@vim.org>
Fri, 23 Mar 2018 21:10:34 +0000 (22:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 23 Mar 2018 21:10:34 +0000 (22:10 +0100)
Problem:    In a terminal dump NUL and space considered are different,
            although they are displayed the same.
Solution:   When encountering NUL handle it like space.

src/terminal.c
src/version.c

index 18da71025640c6e336d9f0f0f82cacef5ec26179..4f29b56699c54b09be9883dd68c1acca98a4c012 100644 (file)
@@ -3396,6 +3396,15 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
 
            for (i = 0; i < VTERM_MAX_CHARS_PER_CELL; ++i)
            {
+               int c = cell.chars[i];
+               int pc = prev_cell.chars[i];
+
+               /* For the first character NUL is the same as space. */
+               if (i == 0)
+               {
+                   c = (c == NUL) ? ' ' : c;
+                   pc = (pc == NUL) ? ' ' : pc;
+               }
                if (cell.chars[i] != prev_cell.chars[i])
                    same_chars = FALSE;
                if (cell.chars[i] == NUL || prev_cell.chars[i] == NUL)
index 473883c99a13df20db9266b0b49e0188b69f2e8e..6999611c0aa133c8eb2246fd09652782fa0e89cc 100644 (file)
@@ -766,6 +766,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1632,
 /**/
     1631,
 /**/