0
0
mirror of https://github.com/vim/vim.git synced 2025-10-16 07:24:23 -04:00

patch 8.2.1027: GUI: multi-byte characters do not work in a terminal

Problem:    GUI: multi-byte characters do not work in a terminal.
Solution:   Do not assume a key is one byte. (closes #6304)
This commit is contained in:
Bram Moolenaar
2020-06-21 15:09:14 +02:00
parent a3b7fdc1bb
commit 820ffa567c
3 changed files with 12 additions and 6 deletions

View File

@@ -1215,7 +1215,10 @@ key_press_event(GtkWidget *widget UNUSED,
if (len == -3)
key = TO_SPECIAL(string[1], string[2]);
else
key = string[0];
{
string[len] = NUL;
key = mb_ptr2char(string);
}
// Handle modifiers.
modifiers = modifiers_gdk2vim(state);
@@ -1240,8 +1243,7 @@ key_press_event(GtkWidget *widget UNUSED,
// May remove the shift modifier if it's included in the key.
modifiers = may_remove_shift_modifier(modifiers, key);
string[0] = key;
len = 1;
len = mb_char2bytes(key, string);
}
if (modifiers != 0)