mirror of
https://github.com/neovim/neovim
synced 2025-07-18 10:11:50 +00:00
fix(termdebug): replace mapset with nvim_set_keymap (#15699)
Co-authored-by: ii14 <ii14@users.noreply.github.com>
This commit is contained in:
@ -826,7 +826,14 @@ func s:InstallCommands()
|
|||||||
command Source call s:GotoSourcewinOrCreateIt()
|
command Source call s:GotoSourcewinOrCreateIt()
|
||||||
command Asm call s:GotoAsmwinOrCreateIt()
|
command Asm call s:GotoAsmwinOrCreateIt()
|
||||||
command Winbar call s:InstallWinbar()
|
command Winbar call s:InstallWinbar()
|
||||||
|
|
||||||
|
if !exists('g:termdebug_map_K') || g:termdebug_map_K
|
||||||
|
" let s:k_map_saved = maparg('K', 'n', 0, 1)
|
||||||
|
let s:k_map_saved = {}
|
||||||
|
for map in nvim_get_keymap('n')
|
||||||
|
if map.lhs ==# 'K'
|
||||||
|
let s:k_map_saved = map
|
||||||
|
break
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
nnoremap K :Evaluate<CR>
|
nnoremap K :Evaluate<CR>
|
||||||
@ -870,7 +877,15 @@ func s:DeleteCommands()
|
|||||||
|
|
||||||
if exists('s:k_map_saved')
|
if exists('s:k_map_saved')
|
||||||
if empty(s:k_map_saved)
|
if empty(s:k_map_saved)
|
||||||
nunmap K
|
nunmap K
|
||||||
|
else
|
||||||
|
" call mapset('n', 0, 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,
|
\ 'silent': s:k_map_saved.silent ? v:true : v:false,
|
||||||
\ })
|
\ })
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user