mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 20:05:38 +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>
(cherry picked from commit 153a910897)
This commit is contained in:
committed by
github-actions[bot]
parent
b868257ef9
commit
b07bffdc47
@@ -1926,7 +1926,17 @@ int put_escstr(FILE *fd, const char *strstart, int what)
|
||||
if (str[1] == KS_MODIFIER) {
|
||||
modifiers = str[2];
|
||||
str += 3;
|
||||
c = *str;
|
||||
|
||||
// Modifiers can be applied too to multi-byte characters.
|
||||
p = mb_unescape((const char **)&str);
|
||||
|
||||
if (p == NULL) {
|
||||
c = *str;
|
||||
} else {
|
||||
// retrieve codepoint (character number) from unescaped string
|
||||
c = utf_ptr2char(p);
|
||||
str--;
|
||||
}
|
||||
}
|
||||
if (c == K_SPECIAL) {
|
||||
c = TO_SPECIAL(str[1], str[2]);
|
||||
|
||||
Reference in New Issue
Block a user