Skip to content

Commit 3d1e500

Browse files
committed
WIP: Added hook to run after commands, to facilitate a user-defined
mapping for repeating commands.
1 parent 9f39160 commit 3d1e500

File tree

3 files changed

+25
-16
lines changed

3 files changed

+25
-16
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ The features that don't work under windows are:
5151
REQUIREMENTS
5252
============
5353

54-
Vebugger requires the vimproc plugin, obtainable from:
55-
https://github.com/Shougo/vimproc.vim. Notice that vimproc needs to be built -
56-
there are instructions in the GitHub page.
54+
Vebugger requires the [vimproc](https://github.com/Shougo/vimproc.vim) and
55+
[repeat.vim](https://github.com/tpope/vim-repeat) plugins. Notice that vimproc
56+
needs to be built - there are instructions in the GitHub page.
5757

5858
In order for Vebugger to use a debugger, that debugger must be installed and
5959
it's executable must be either be in the PATH or set with a global variable

doc/vebugger.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ source file paths.
227227
USING THE DEBUGGERS *vebugger-usage* *vebugger-commands*
228228

229229
Once you have launched a debugger, you can use the following commands to
230-
interact with it:
230+
interact with it. They may be repeated using '.'
231231

232232

233233
CONTROL THE EXECUTION OF THE PROGRAM *vebugger-execution-control*

plugin/vebugger.vim

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11

2+
function! s:recordCall(...)
3+
let l:func=a:1
4+
let l:args=a:000[1:]
5+
call call(l:func,l:args)
26

3-
command! -nargs=1 VBGrawWrite call vebugger#writeLine(<q-args>)
7+
if(exists('*VBGpostcmd'))
8+
call VBGpostcmd(l:func,l:args)
9+
endif
10+
endfunction
11+
12+
command! -nargs=1 VBGrawWrite call s:recordCall('vebugger#writeLine',<q-args>)
413
command! -nargs=0 VBGkill call vebugger#killDebugger()
514

6-
command! -nargs=0 VBGstepIn call vebugger#setWriteActionAndPerform('std','flow','stepin')
7-
command! -nargs=0 VBGstepOver call vebugger#setWriteActionAndPerform('std','flow','stepover')
8-
command! -nargs=0 VBGstepOut call vebugger#setWriteActionAndPerform('std','flow','stepout')
9-
command! -nargs=0 VBGcontinue call vebugger#setWriteActionAndPerform('std','flow','continue')
15+
command! -nargs=0 VBGstepIn call s:recordCall('vebugger#setWriteActionAndPerform','std','flow','stepin')
16+
command! -nargs=0 VBGstepOver call s:recordCall('vebugger#setWriteActionAndPerform','std','flow','stepover')
17+
command! -nargs=0 VBGstepOut call s:recordCall('vebugger#setWriteActionAndPerform','std','flow','stepout')
18+
command! -nargs=0 VBGcontinue call s:recordCall('vebugger#setWriteActionAndPerform','std','flow','continue')
1019

1120
command! -nargs=0 VBGtoggleTerminalBuffer call vebugger#toggleTerminalBuffer()
1221
command! -nargs=+ -complete=file VBGtoggleBreakpoint call vebugger#std#toggleBreakpoint(<f-args>)
13-
command! -nargs=0 VBGtoggleBreakpointThisLine call vebugger#std#toggleBreakpoint(expand('%:~:.'),line('.'))
22+
command! -nargs=0 VBGtoggleBreakpointThisLine call s:recordCall('vebugger#std#toggleBreakpoint', expand('%:~:.'),line('.'))
1423
command! -nargs=0 VBGclearBreakpints call vebugger#std#clearBreakpoints()
1524

16-
command! -nargs=1 VBGeval call vebugger#std#eval(<q-args>)
17-
command! -nargs=0 VBGevalWordUnderCursor call vebugger#std#eval(expand('<cword>'))
18-
command! -nargs=1 VBGexecute call vebugger#std#execute(<q-args>)
25+
command! -nargs=1 VBGeval call s:recordCall('vebugger#std#eval',<q-args>)
26+
command! -nargs=0 VBGevalWordUnderCursor call s:recordCall('vebugger#std#eval',expand('<cword>'))
27+
command! -nargs=1 VBGexecute call s:recordCall('vebugger#std#execute',<q-args>)
1928

20-
command! -range -nargs=0 VBGevalSelectedText call vebugger#std#eval(vebugger#util#get_visual_selection())
21-
command! -range -nargs=0 VBGexecuteSelectedText call vebugger#std#execute(vebugger#util#get_visual_selection())
22-
command! -range -nargs=0 VBGrawWriteSelectedText call vebugger#writeLine(vebugger#util#get_visual_selection())
29+
command! -range -nargs=0 VBGevalSelectedText call s:recordCall('vebugger#std#eval',vebugger#util#get_visual_selection())
30+
command! -range -nargs=0 VBGexecuteSelectedText call s:recordCall('vebugger#std#execute',vebugger#util#get_visual_selection())
31+
command! -range -nargs=0 VBGrawWriteSelectedText call s:recordCall('vebugger#writeLine',vebugger#util#get_visual_selection())
2332

2433
command! -nargs=+ -complete=file VBGstartGDB call vebugger#gdb#start([<f-args>][0],{'args':[<f-args>][1:]})
2534
command! -nargs=1 -complete=file VBGattachGDB call vebugger#gdb#searchAndAttach(<q-args>)

0 commit comments

Comments
 (0)