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/testdir/test_mksession_utf8.vim b/src/testdir/test_mksession_utf8.vim
index 4e593cc..36cb38b 100644
--- a/src/testdir/test_mksession_utf8.vim
+++ b/src/testdir/test_mksession_utf8.vim
@@ -102,4 +102,35 @@
set sessionoptions& splitbelow& fileencoding&
endfunc
+func Test_session_multibyte_mappings()
+
+ " some characters readily available on european keyboards
+ let entries = [
+ \ ['n', '<M-ç>', '<M-ç>'],
+ \ ['n', '<M-º>', '<M-º>'],
+ \ ['n', '<M-¡>', '<M-¡>'],
+ \ ]
+ for entry in entries
+ exe entry[0] .. 'map ' .. entry[1] .. ' ' .. entry[2]
+ endfor
+
+ mkvimrc Xtestvimrc
+
+ nmapclear
+
+ for entry in entries
+ call assert_equal('', maparg(entry[1], entry[0]))
+ endfor
+
+ source Xtestvimrc
+
+ for entry in entries
+ call assert_equal(entry[2], maparg(entry[1], entry[0]))
+ endfor
+
+ nmapclear
+
+ call delete('Xtestvimrc')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab