summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlackEagle <ike.devolder@gmail.com>2019-07-06 08:21:56 +0200
committerBlackEagle <ike.devolder@gmail.com>2019-07-06 08:21:56 +0200
commite382fe9d95796ef01c31f93c17c38a57083de585 (patch)
tree38394300d233b5db896b556e27bb4e24afaf8013
parentacc73be03654fca6cd9ddd921b9e3bc17f4a6aef (diff)
downloadvdebug-e382fe9d95796ef01c31f93c17c38a57083de585.zip
add more clarity to the Vdebug_load_keymaps function
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
-rw-r--r--plugin/vdebug.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/vdebug.vim b/plugin/vdebug.vim
index 084e640..855a6c0 100644
--- a/plugin/vdebug.vim
+++ b/plugin/vdebug.vim
@@ -223,10 +223,14 @@ endfunction
" This should be called if you want to update the keymappings after vdebug has
" been loaded.
function! Vdebug_load_keymaps(keymaps)
- " Unmap existing keys, if applicable
+ " Unmap existing keys, if needed
+ " the keys should in theory exist because they are part of the defaults
if has_key(g:vdebug_keymap, 'run')
exe 'silent! nunmap '.g:vdebug_keymap['run']
endif
+ if has_key(g:vdebug_keymap, 'close')
+ exe 'silent! nunmap '.g:vdebug_keymap['close']
+ endif
if has_key(g:vdebug_keymap, 'set_breakpoint')
exe 'silent! nunmap '.g:vdebug_keymap['set_breakpoint']
endif
@@ -238,6 +242,7 @@ function! Vdebug_load_keymaps(keymaps)
let g:vdebug_keymap = extend(g:vdebug_keymap_defaults, a:keymaps)
" Mappings allowed in non-debug mode
+ " XXX: don't use keymaps not found in g:vdebug_keymap_defaults
exe 'noremap '.g:vdebug_keymap['run'].' :python3 debugger.run()<cr>'
exe 'noremap '.g:vdebug_keymap['close'].' :python3 debugger.close()<cr>'
exe 'noremap '.g:vdebug_keymap['set_breakpoint'].' :python3 debugger.set_breakpoint()<cr>'