comparison 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
comparison
equal deleted inserted replaced
13516:55d9bd45e2c1 13517:d0d66898e98b
3394 if (vterm_screen_get_cell(screen, pos, &cell) == 0) 3394 if (vterm_screen_get_cell(screen, pos, &cell) == 0)
3395 vim_memset(&cell, 0, sizeof(cell)); 3395 vim_memset(&cell, 0, sizeof(cell));
3396 3396
3397 for (i = 0; i < VTERM_MAX_CHARS_PER_CELL; ++i) 3397 for (i = 0; i < VTERM_MAX_CHARS_PER_CELL; ++i)
3398 { 3398 {
3399 int c = cell.chars[i];
3400 int pc = prev_cell.chars[i];
3401
3402 /* For the first character NUL is the same as space. */
3403 if (i == 0)
3404 {
3405 c = (c == NUL) ? ' ' : c;
3406 pc = (pc == NUL) ? ' ' : pc;
3407 }
3399 if (cell.chars[i] != prev_cell.chars[i]) 3408 if (cell.chars[i] != prev_cell.chars[i])
3400 same_chars = FALSE; 3409 same_chars = FALSE;
3401 if (cell.chars[i] == NUL || prev_cell.chars[i] == NUL) 3410 if (cell.chars[i] == NUL || prev_cell.chars[i] == NUL)
3402 break; 3411 break;
3403 } 3412 }