@@ -118,7 +118,9 @@ command! VdebugStart python3 debugger.run()
118118command ! -nargs =? BreakpointRemove python3 debugger.remove_breakpoint (<q-args> )
119119command ! BreakpointWindow python3 debugger.toggle_breakpoint_window ()
120120command ! -nargs =? - bang VdebugEval python3 debugger.handle_eval (' <bang>' , <q-args> )
121- command ! -nargs =+ -complete =customlist ,s: OptionNames VdebugOpt python3 debugger.handle_opt (<f-args> )
121+ command ! -nargs =+ -complete =customlist ,s: OptionNames VdebugOpt :call Vdebug_set_option (<f-args> )
122+ command ! -nargs =+ VdebugPathMap :call Vdebug_path_map (<f-args> )
123+ command ! -nargs =+ VdebugAddPathMap :call Vdebug_add_path_map (<f-args> )
122124command ! -nargs =? VdebugTrace python3 debugger.handle_trace (<q-args> )
123125
124126if hlexists (" DbgCurrentLine" ) == 0
@@ -246,6 +248,38 @@ function! s:OptionNames(A,L,P)
246248 endif
247249endfunction
248250
251+ function ! Vdebug_set_option (option , ... )
252+ if ! a: 0
253+ let g: vdebug_options [a: option ]
254+ return
255+ endif
256+ if a: option == ' path_maps'
257+ echomsg ' use :VdebugAddPathMap to add extra or :VdebugPathMap to set new'
258+ return
259+ elseif a: option == ' window_commands'
260+ echomsg ' update window_commands in your vimrc please'
261+ return
262+ elseif a: option == ' window_arrangement'
263+ echomsg ' update window_arrangement in your vimrc please'
264+ return
265+ endif
266+ echomsg ' Setting vdebug option "' . a: option . ' " to: ' . a: 1
267+ let g: vdebug_options [a: option ] = a: 1
268+ exe " :python3 debugger.reload_options()"
269+ endfunction
270+
271+ function ! Vdebug_add_path_map (from, to )
272+ echomsg ' Adding vdebug path map "{' . a: from . ' :' . a: to . ' }"'
273+ let g: vdebug_options [' path_maps' ] = extend (g: vdebug_options [' path_maps' ], {a: from : a: to })
274+ exe " :python3 debugger.reload_options()"
275+ endfunction
276+
277+ function ! Vdebug_path_map (from, to )
278+ echomsg ' Setting vdebug path maps to "{' . a: from . ' :' . a: to . ' }"'
279+ let g: vdebug_options [' path_maps' ] = {a: from : a: to }
280+ exe " :python3 debugger.reload_options()"
281+ endfunction
282+
249283function ! Vdebug_get_visual_selection ()
250284 let [lnum1, col1] = getpos (" '<" )[1 :2 ]
251285 let [lnum2, col2] = getpos (" '>" )[1 :2 ]
0 commit comments