mirror of
https://github.com/neovim/neovim.git
synced 2026-04-23 15:55:36 +00:00
feat(mapset): support restoring Lua callback (#20024)
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly
Problem: mapset() does not restore <Nop> mapping properly.
Solution: Use an empty string for <Nop>. (closes vim/vim#11022)
92a3d20682
This commit is contained in:
@@ -964,14 +964,7 @@ func s:DeleteCommands()
|
||||
nunmap K
|
||||
else
|
||||
" call mapset(s:k_map_saved)
|
||||
let mode = s:k_map_saved.mode !=# ' ' ? s:k_map_saved.mode : ''
|
||||
call nvim_set_keymap(mode, 'K', s:k_map_saved.rhs, {
|
||||
\ 'expr': s:k_map_saved.expr ? v:true : v:false,
|
||||
\ 'noremap': s:k_map_saved.noremap ? v:true : v:false,
|
||||
\ 'nowait': s:k_map_saved.nowait ? v:true : v:false,
|
||||
\ 'script': s:k_map_saved.script ? v:true : v:false,
|
||||
\ 'silent': s:k_map_saved.silent ? v:true : v:false,
|
||||
\ })
|
||||
call mapset('n', 0, s:k_map_saved)
|
||||
endif
|
||||
unlet s:k_map_saved
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user