comparison src/testdir/test_map_functions.vim @ 28800:fea88e555652 v8.2.4924

patch 8.2.4924: maparg() may return a string that cannot be reused Commit: https://github.com/vim/vim/commit/0519ce00394474055bd58c089ea90a19986443eb Author: zeertzjq <zeertzjq@outlook.com> Date: Mon May 9 12:16:19 2022 +0100 patch 8.2.4924: maparg() may return a string that cannot be reused Problem: maparg() may return a string that cannot be reused. Solution: use msg_outtrans_special() instead of str2special(). (closes #10384)
author Bram Moolenaar <Bram@vim.org>
date Mon, 09 May 2022 13:30:03 +0200
parents 38f7a132bba3
children 1ad71fcbf546
comparison
equal deleted inserted replaced
28799:6f38b93c8683 28800:fea88e555652
56 map abc x<char-114>x 56 map abc x<char-114>x
57 call assert_equal("xrx", maparg('abc')) 57 call assert_equal("xrx", maparg('abc'))
58 map abc y<S-char-114>y 58 map abc y<S-char-114>y
59 call assert_equal("yRy", maparg('abc')) 59 call assert_equal("yRy", maparg('abc'))
60 60
61 " character with K_SPECIAL byte
62 nmap abc …
63 call assert_equal('…', maparg('abc'))
64
65 " modified character with K_SPECIAL byte
66 nmap abc <M-…>
67 call assert_equal('<M-…>', maparg('abc'))
68
69 " illegal bytes
70 let str = ":\x7f:\x80:\x90:\xd0:"
71 exe 'nmap abc ' .. str
72 call assert_equal(str, maparg('abc'))
73 unlet str
74
61 omap { w 75 omap { w
62 let d = maparg('{', 'o', 0, 1) 76 let d = maparg('{', 'o', 0, 1)
63 call assert_equal(['{', 'w', 'o'], [d.lhs, d.rhs, d.mode]) 77 call assert_equal(['{', 'w', 'o'], [d.lhs, d.rhs, d.mode])
64 ounmap { 78 ounmap {
65 79