Skip to content

Commit

Permalink
Merge pull request #128 from tommcdo/breakpoint-complete
Browse files Browse the repository at this point in the history
Add completion to :Breakpoint command
  • Loading branch information
joonty committed Jan 21, 2014
2 parents 32672ab + e9ea8c0 commit f01a51e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion plugin/vdebug.vim
Expand Up @@ -118,7 +118,7 @@ exe "noremap ".g:vdebug_keymap["set_breakpoint"]." :python debugger.set_breakpoi
exe "vnoremap ".g:vdebug_keymap["eval_visual"]." :python debugger.handle_visual_eval()<cr>"

" Commands
command! -nargs=? Breakpoint python debugger.set_breakpoint(<q-args>)
command! -nargs=? -complete=customlist,s:BreakpointTypes Breakpoint python debugger.set_breakpoint(<q-args>)
command! -nargs=? BreakpointRemove python debugger.remove_breakpoint(<q-args>)
command! BreakpointWindow python debugger.toggle_breakpoint_window()
command! -nargs=? VdebugEval python debugger.handle_eval(<q-args>)
Expand All @@ -132,6 +132,16 @@ hi default DbgCurrentSign term=reverse ctermfg=White ctermbg=Red guifg=#ffffff g
hi default DbgBreakptLine term=reverse ctermfg=White ctermbg=Green guifg=#ffffff guibg=#00ff00
hi default DbgBreakptSign term=reverse ctermfg=White ctermbg=Green guifg=#ffffff guibg=#00ff00

function! s:BreakpointTypes(A,L,P)
let arg_to_cursor = strpart(a:L,11,a:P)
let space_idx = stridx(arg_to_cursor,' ')
if space_idx == -1
return filter(['conditional ','exception ','return ','call ','watch '],'v:val =~ "^".a:A.".*"')
else
return []
endif
endfunction

function! s:OptionNames(A,L,P)
let arg_to_cursor = strpart(a:L,10,a:P)
let space_idx = stridx(arg_to_cursor,' ')
Expand Down

0 comments on commit f01a51e

Please sign in to comment.