summaryrefslogtreecommitdiff
path: root/plugin/vdebug.vim
diff options
context:
space:
mode:
authorBlackEagle <ike.devolder@gmail.com>2018-03-21 21:00:52 +0100
committerBlackEagle <ike.devolder@gmail.com>2018-03-21 21:00:52 +0100
commit20c6727450e9f28b9e2ef499e2a8320b214c0967 (patch)
treeea56018bc1f5da38cb0aa39d13a02521a9160192 /plugin/vdebug.vim
parent4b5616be67dafa890cb6b574814ce92495b5fa4f (diff)
downloadvdebug-20c6727450e9f28b9e2ef499e2a8320b214c0967.zip
add vim functions to add or set the path maps
removed the setting of options via the python way and set the options in vimscript, with some exceptions where stated to use other functions or place the desired configuration in .vimrc fixes #228 Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Diffstat (limited to 'plugin/vdebug.vim')
-rw-r--r--plugin/vdebug.vim36
1 files changed, 35 insertions, 1 deletions
diff --git a/plugin/vdebug.vim b/plugin/vdebug.vim
index 9bd040e..6b6e24f 100644
--- a/plugin/vdebug.vim
+++ b/plugin/vdebug.vim
@@ -118,7 +118,9 @@ command! VdebugStart python3 debugger.run()
command! -nargs=? BreakpointRemove python3 debugger.remove_breakpoint(<q-args>)
command! BreakpointWindow python3 debugger.toggle_breakpoint_window()
command! -nargs=? -bang VdebugEval python3 debugger.handle_eval('<bang>', <q-args>)
-command! -nargs=+ -complete=customlist,s:OptionNames VdebugOpt python3 debugger.handle_opt(<f-args>)
+command! -nargs=+ -complete=customlist,s:OptionNames VdebugOpt :call Vdebug_set_option(<f-args>)
+command! -nargs=+ VdebugPathMap :call Vdebug_path_map(<f-args>)
+command! -nargs=+ VdebugAddPathMap :call Vdebug_add_path_map(<f-args>)
command! -nargs=? VdebugTrace python3 debugger.handle_trace(<q-args>)
if hlexists("DbgCurrentLine") == 0
@@ -246,6 +248,38 @@ function! s:OptionNames(A,L,P)
endif
endfunction
+function! Vdebug_set_option(option, ...)
+ if ! a:0
+ let g:vdebug_options[a:option]
+ return
+ endif
+ if a:option == 'path_maps'
+ echomsg 'use :VdebugAddPathMap to add extra or :VdebugPathMap to set new'
+ return
+ elseif a:option == 'window_commands'
+ echomsg 'update window_commands in your vimrc please'
+ return
+ elseif a:option == 'window_arrangement'
+ echomsg 'update window_arrangement in your vimrc please'
+ return
+ endif
+ echomsg 'Setting vdebug option "' . a:option . '" to: ' . a:1
+ let g:vdebug_options[a:option] = a:1
+ exe ":python3 debugger.reload_options()"
+endfunction
+
+function! Vdebug_add_path_map(from, to)
+ echomsg 'Adding vdebug path map "{' . a:from . ':' . a:to . '}"'
+ let g:vdebug_options['path_maps'] = extend(g:vdebug_options['path_maps'], {a:from: a:to})
+ exe ":python3 debugger.reload_options()"
+endfunction
+
+function! Vdebug_path_map(from, to)
+ echomsg 'Setting vdebug path maps to "{' . a:from . ':' . a:to . '}"'
+ let g:vdebug_options['path_maps'] = {a:from: a:to}
+ exe ":python3 debugger.reload_options()"
+endfunction
+
function! Vdebug_get_visual_selection()
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]