Skip to content

Commit 0e59556

Browse files
Gregg Jensenlucs
Gregg Jensen
authored andcommitted
Implement the "step out" feature.
1 parent 2a806fc commit 0e59556

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

lib/Vim/Debug.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ sub translate {
244244

245245
if ($in =~ /^next$/ ) { @cmds = $self->next }
246246
elsif ($in =~ /^step$/ ) { @cmds = $self->step }
247+
elsif ($in =~ /^stepout$/ ) { @cmds = $self->stepout }
247248
elsif ($in =~ /^cont$/ ) { @cmds = $self->cont }
248249
elsif ($in =~ /^break:(\d+):(.+)$/) { @cmds = $self->break($1, $2) }
249250
elsif ($in =~ /^clear:(\d+):(.+)$/) { @cmds = $self->clear($1, $2) }

lib/Vim/Debug/Perl.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ debugger uses 'n'.
4949
=cut
5050
sub next { 'n' }
5151
sub step { 's' }
52+
sub stepout { 'r' }
5253
sub cont { 'c' }
5354
sub break { "f $_[2]", "b $_[1]" }
5455
sub clear { "f $_[2]", "B $_[1]" }

lib/Vim/Debug/_vim/doc/VimDebug.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@ change them by editing VimDebug.vim.
8383

8484
These are the default key bindings. To change them edit VimDebug.vim.
8585

86-
<F12> Start the debugger, or toggle the key bindigs.
86+
<F12> Start the debugger, or toggle the key bindings.
8787
<F11> Exit the debugger.
8888
<F10> Restart the debugger. Breakpoints are saved.
8989

9090
<F9> Continue.
9191
<F8> Next.
92-
<F7> Step.
92+
<F7> Step in.
93+
<F6> Step out.
9394

9495
<Leader>b Set breakpoint on the current line.
9596
<Leader>c Clear breakpoint on the current line.

lib/Vim/Debug/_vim/plugin/VimDebug.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ let s:dbgr_keys = [
3535
\ ["<F9>", ":DBGRcont<cr>"],
3636
\ ["<F8>", ":DBGRnext<cr>"],
3737
\ ["<F7>", ":DBGRstep<cr>"],
38+
\ ["<F6>", ":DBGRstepout<cr>"],
3839
\ ["<Leader>b", ":DBGRsetBreakPoint<cr>"],
3940
\ ["<Leader>c", ":DBGRclearBreakPoint<cr>"],
4041
\ ["<Leader>ca", ":DBGRclearAllBreakPoints<cr>"],
@@ -205,6 +206,7 @@ endfunction
205206

206207
" Debugger functions.
207208

209+
command! -nargs=0 DBGRstepout call DBGRstepout()
208210
command! -nargs=0 DBGRstep call DBGRstep()
209211
command! -nargs=0 DBGRnext call DBGRnext()
210212
command! -nargs=0 DBGRcont call DBGRcont()
@@ -234,6 +236,15 @@ function! DBGRstep()
234236
call s:HandleCmdResult()
235237
endfunction
236238

239+
function! DBGRstepout()
240+
if !s:Copacetic()
241+
return
242+
endif
243+
echo "\rstepout..."
244+
call s:SocketWrite("stepout")
245+
call s:HandleCmdResult()
246+
endfunction
247+
237248
function! DBGRcont()
238249
if !s:Copacetic()
239250
return

0 commit comments

Comments
 (0)