From b2b0550c46db7c65f6a6a8d65505c01065a2f3b6 Mon Sep 17 00:00:00 2001 From: IdanArye Date: Sat, 17 May 2014 19:41:32 +0300 Subject: [PATCH] Added statement execution for PDB --- autoload/vebugger/pdb.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/autoload/vebugger/pdb.vim b/autoload/vebugger/pdb.vim index cb6a3f7..42eff43 100644 --- a/autoload/vebugger/pdb.vim +++ b/autoload/vebugger/pdb.vim @@ -16,6 +16,7 @@ function! vebugger#pdb#start(entryFile,args) call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints')) call l:debugger.setWriteHandler('std','closeDebugger',function('s:closeDebugger')) call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression')) + call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements')) call l:debugger.setWriteHandler('std','removeAfterDisplayed',function('s:removeAfterDisplayed')) call l:debugger.generateWriteActionsFromTemplate() @@ -27,7 +28,12 @@ endfunction function! s:readProgramOutput(pipeName,line,readResult,debugger) dict if 'out'==a:pipeName + if a:line=~"\\V\[C" " After executing commands this seems to get appended... + let self.programOutputMode=1 + return + endif if a:line=~'\v^\>' + \||a:line=~'\V\^(Pdb)' "We don't want to print this particular line... \||a:line=='--Return--' \||a:line=='The program finished and will be restarted' let self.programOutputMode=0 @@ -97,6 +103,14 @@ function! s:requestEvaluateExpression(writeAction,debugger) endfor endfunction +function! s:executeStatements(writeAction,debugger) + for l:evalAction in a:writeAction + if has_key(l:evalAction,'statement') + call a:debugger.writeLine('!'.l:evalAction.statement) + endif + endfor +endfunction + function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger) if 'out'==a:pipeName if 1==a:debugger.state.pdb.willPrintNext.stage "Reading the empty line after the command