mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
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)
This commit is contained in:
@@ -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])
|
||||
|
Reference in New Issue
Block a user