summaryrefslogtreecommitdiff
path: root/src/testdir/test_map_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-09 12:16:19 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-09 12:16:19 +0100
commit0519ce00394474055bd58c089ea90a19986443eb (patch)
treef4d1447bec6c7b3e1977f9bdc7b811eb27c63a0d /src/testdir/test_map_functions.vim
parent194843028ed486366b89e8f7d3bdd611a11ce7b4 (diff)
downloadvim-git-8.2.4924.tar.gz
patch 8.2.4924: maparg() may return a string that cannot be reusedv8.2.4924
Problem: maparg() may return a string that cannot be reused. Solution: use msg_outtrans_special() instead of str2special(). (closes #10384)
Diffstat (limited to 'src/testdir/test_map_functions.vim')
-rw-r--r--src/testdir/test_map_functions.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_map_functions.vim b/src/testdir/test_map_functions.vim
index 21c899048..e13807647 100644
--- a/src/testdir/test_map_functions.vim
+++ b/src/testdir/test_map_functions.vim
@@ -58,6 +58,20 @@ func Test_maparg()
map abc y<S-char-114>y
call assert_equal("yRy", maparg('abc'))
+ " character with K_SPECIAL byte
+ nmap abc …
+ call assert_equal('…', maparg('abc'))
+
+ " modified character with K_SPECIAL byte
+ nmap abc <M-…>
+ call assert_equal('<M-…>', maparg('abc'))
+
+ " illegal bytes
+ let str = ":\x7f:\x80:\x90:\xd0:"
+ exe 'nmap abc ' .. str
+ call assert_equal(str, maparg('abc'))
+ unlet str
+
omap { w
let d = maparg('{', 'o', 0, 1)
call assert_equal(['{', 'w', 'o'], [d.lhs, d.rhs, d.mode])