0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.0.1203: terminal window mistreats composing characters

Problem:    Terminal window mistreats composing characters.
Solution:   Count composing characters with the base character. (Ozaki Kiichi,
            closes #2195)
This commit is contained in:
Bram Moolenaar
2017-10-15 22:56:49 +02:00
parent 059db5c29f
commit 6daeef1933
4 changed files with 74 additions and 6 deletions

View File

@@ -40,12 +40,9 @@
* TODO:
* - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
* Higashi, 2017 Sep 19)
* - patch to handle composing characters. (Ozaki Kiichi, #2195)
* - double click in Window toolbar starts Visual mode (but not always?).
* - Shift-Tab does not work.
* - after resizing windows overlap. (Boris Staletic, #2164)
* - :wall gives an error message. (Marius Gedminas, #2190)
* patch suggested by Yasuhiro Matsumoto, Oct 10
* - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
* is disabled.
* - cursor blinks in terminal on widows with a timer. (xtal8, #2142)
@@ -2299,7 +2296,6 @@ term_update_window(win_T *wp)
if (vterm_screen_get_cell(screen, pos, &cell) == 0)
vim_memset(&cell, 0, sizeof(cell));
/* TODO: composing chars */
c = cell.chars[0];
if (c == NUL)
{
@@ -2311,7 +2307,18 @@ term_update_window(win_T *wp)
{
if (enc_utf8)
{
if (c >= 0x80)
int i;
/* composing chars */
for (i = 0; i < Screen_mco
&& i + 1 < VTERM_MAX_CHARS_PER_CELL; ++i)
{
ScreenLinesC[i][off] = cell.chars[i + 1];
if (cell.chars[i + 1] == 0)
break;
}
if (c >= 0x80 || (Screen_mco > 0
&& ScreenLinesC[0][off] != 0))
{
ScreenLines[off] = ' ';
ScreenLinesUC[off] = c;
@@ -3157,7 +3164,7 @@ f_term_sendkeys(typval_T *argvars, typval_T *rettv)
while (*msg != NUL)
{
send_keys_to_term(term, PTR2CHAR(msg), FALSE);
msg += MB_PTR2LEN(msg);
msg += MB_CPTR2LEN(msg);
}
}