patch 9.1.1402: multi-byte mappings not properly stored in session file
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: #17355
Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/map.c b/src/map.c
index 209d9d2..2d378b5 100644
--- a/src/map.c
+++ b/src/map.c
@@ -2180,7 +2180,18 @@
{
modifiers = str[2];
str += 3;
- c = *str;
+
+ // Modifiers can be applied too to multi-byte characters.
+ p = mb_unescape(&str);
+
+ if (p == NULL)
+ c = *str;
+ else
+ {
+ // retrieve codepoint (character number) from unescaped string
+ c = (*mb_ptr2char)(p);
+ --str;
+ }
}
if (c == K_SPECIAL)
{