0
0
mirror of https://github.com/vim/vim.git synced 2025-10-31 09:57:14 -04:00

patch 8.0.0991: using wrong character conversion for DBCS

Problem:    Using wrong character conversion for DBCS.
Solution:   Use utf_char2bytes instead of mb_char2bytes. (Yasuhiro Matsumoto,
            closes #2012)
This commit is contained in:
Bram Moolenaar
2017-08-23 23:36:25 +02:00
parent 285f243e50
commit 6c4d12c527
2 changed files with 4 additions and 2 deletions

View File

@@ -945,7 +945,7 @@ move_terminal_to_buffer(term_T *term)
width = 1; width = 1;
vim_memset(p + pos.col, 0, sizeof(cellattr_T)); vim_memset(p + pos.col, 0, sizeof(cellattr_T));
if (ga_grow(&ga, 1) == OK) if (ga_grow(&ga, 1) == OK)
ga.ga_len += mb_char2bytes(' ', ga.ga_len += utf_char2bytes(' ',
(char_u *)ga.ga_data + ga.ga_len); (char_u *)ga.ga_data + ga.ga_len);
} }
else else
@@ -1943,7 +1943,7 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
break; break;
} }
for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i) for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i)
ga.ga_len += mb_char2bytes(c == NUL ? ' ' : c, ga.ga_len += utf_char2bytes(c == NUL ? ' ' : c,
(char_u *)ga.ga_data + ga.ga_len); (char_u *)ga.ga_data + ga.ga_len);
p[col].width = cells[col].width; p[col].width = cells[col].width;
p[col].attrs = cells[col].attrs; p[col].attrs = cells[col].attrs;

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
991,
/**/ /**/
990, 990,
/**/ /**/