vim-patch:8.2.4831: crash when using maparg() and unmapping simplified keys

Problem:    Crash when using maparg() and unmapping simplified keys.
Solution:   Do not keep a mapblock pointer. (closes vim/vim#10294)
2c8a7ebdad

N/A patches for version.c:

vim-patch:8.2.0832: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution:   Add initial value.
a55ba06f69
This commit is contained in:
zeertzjq
2022-08-01 15:38:54 +08:00
parent 34e7dc5d05
commit 9cebfbe6ab

View File

@@ -85,6 +85,12 @@ func Test_maparg()
call assert_equal(['{', 'w', 's'], [d.lhs, d.rhs, d.mode]) call assert_equal(['{', 'w', 's'], [d.lhs, d.rhs, d.mode])
sunmap { sunmap {
map <C-I> foo
unmap <Tab>
" This used to cause a segfault
call maparg('<C-I>', '', 0, 1)
unmap <C-I>
map abc <Nop> map abc <Nop>
call assert_equal("<Nop>", maparg('abc')) call assert_equal("<Nop>", maparg('abc'))
unmap abc unmap abc
@@ -93,6 +99,7 @@ func Test_maparg()
let d = maparg('esc', 'i', 1, 1) let d = maparg('esc', 'i', 1, 1)
call assert_equal(['esc', "\<C-V>\<C-V>\<Esc>", '!'], [d.lhs, d.rhs, d.mode]) call assert_equal(['esc', "\<C-V>\<C-V>\<Esc>", '!'], [d.lhs, d.rhs, d.mode])
abclear abclear
unlet d
endfunc endfunc
func Test_mapcheck() func Test_mapcheck()