mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.1.1402: multi-byte mappings not properly stored in session file (#34131)
Problem: multi-byte mappings not properly stored in session file
Solution: unescape the mapping before writing out the mapping, prefer
single-byte mapping name if possible (Miguel Barro)
closes: vim/vim#17355
5b07aff2f6
Co-authored-by: GuyBrush <miguel.barro@live.com>
This commit is contained in:
@@ -326,10 +326,11 @@ char *get_special_key_name(int c, int modifiers)
|
||||
string[idx++] = (char)(uint8_t)KEY2TERMCAP1(c);
|
||||
} else {
|
||||
// Not a special key, only modifiers, output directly.
|
||||
if (utf_char2len(c) > 1) {
|
||||
idx += utf_char2bytes(c, string + idx);
|
||||
} else if (vim_isprintc(c)) {
|
||||
int len = utf_char2len(c);
|
||||
if (len == 1 && vim_isprintc(c)) {
|
||||
string[idx++] = (char)(uint8_t)c;
|
||||
} else if (len > 1) {
|
||||
idx += utf_char2bytes(c, string + idx);
|
||||
} else {
|
||||
char *s = transchar(c);
|
||||
while (*s) {
|
||||
|
Reference in New Issue
Block a user