diff src/terminal.c @ 13517:d0d66898e98b v8.0.1632

patch 8.0.1632: in a terminal dump NUL and space are different commit https://github.com/vim/vim/commit/47015b80a0b0ff74ba7cb597d5959604b6e9a511 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 23 22:10:34 2018 +0100 patch 8.0.1632: in a terminal dump NUL and space are different 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.
author Christian Brabandt <cb@256bit.org>
date Fri, 23 Mar 2018 22:15:06 +0100
parents a784ef72b617
children e9ffb5b35266
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -3396,6 +3396,15 @@ f_term_dumpwrite(typval_T *argvars, typv
 
 	    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)