From 7a1bf4926e0a17ebe7376ee48d12ff34f477e4c5 Mon Sep 17 00:00:00 2001 From: Daniel Morris Date: Thu, 19 Jul 2018 00:25:26 -0500 Subject: [PATCH] Just more code to support this --- autoload/vebugger/ninspect.vim | 59 +++++++++++++++++----------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/autoload/vebugger/ninspect.vim b/autoload/vebugger/ninspect.vim index 6557fb7..578426d 100644 --- a/autoload/vebugger/ninspect.vim +++ b/autoload/vebugger/ninspect.vim @@ -13,7 +13,7 @@ function! vebugger#ninspect#attach(connection, args) call l:debugger.addReadHandler(function('vebugger#ninspect#_readProgramOutput')) call l:debugger.addReadHandler(function('vebugger#ninspect#_readWhere')) - " call l:debugger.addReadHandler(function('vebugger#ninspect#_readEvaluatedExpressions')) + call l:debugger.addReadHandler(function('vebugger#ninspect#_readEvaluatedExpressions')) call l:debugger.addReadHandler(function('vebugger#ninspect#_readFinish')) call l:debugger.setWriteHandler('std','flow',function('vebugger#ninspect#_writeFlow')) @@ -26,12 +26,13 @@ function! vebugger#ninspect#attach(connection, args) call l:debugger.generateWriteActionsFromTemplate() - call l:debugger.std_addAllBreakpointActions(g:vebugger_breakpoints) + " call l:debugger.std_addAllBreakpointActions(g:vebugger_breakpoints) " Don't stop at the beginning " call l:debugger.writeLine('cont') let s:programOutputMode=0 + let s:programEvalMode=0 return l:debugger endfunction @@ -50,7 +51,7 @@ function! vebugger#ninspect#start(entryFile,args) call l:debugger.addReadHandler(function('vebugger#ninspect#_readProgramOutput')) call l:debugger.addReadHandler(function('vebugger#ninspect#_readWhere')) - " call l:debugger.addReadHandler(function('vebugger#ninspect#_readEvaluatedExpressions')) + call l:debugger.addReadHandler(function('vebugger#ninspect#_readEvaluatedExpressions')) call l:debugger.addReadHandler(function('vebugger#ninspect#_readFinish')) call l:debugger.setWriteHandler('std','flow',function('vebugger#ninspect#_writeFlow')) @@ -63,15 +64,16 @@ function! vebugger#ninspect#start(entryFile,args) call l:debugger.generateWriteActionsFromTemplate() - call l:debugger.std_addAllBreakpointActions(g:vebugger_breakpoints) - + " call l:debugger.std_addAllBreakpointActions(g:vebugger_breakpoints) " Don't stop at the beginning " call l:debugger.writeLine('cont') let s:programOutputMode=0 + let s:programEvalMode=0 return l:debugger endfunction function! vebugger#ninspect#_readProgramOutput(pipeName,line,readResult,debugger) + " echom a:line if 'err'==a:pipeName let a:readResult.std.programOutput={'line':a:line} else @@ -85,8 +87,9 @@ function! vebugger#ninspect#_readProgramOutput(pipeName,line,readResult,debugger let a:readResult.std.programOutput={'line':l:matches[2]} endif else - let l:startmatch=matchlist(a:line,'\vdebug\>') + let l:startmatch=matchlist(a:line,'\vfunction') if 1.............\<\sWaiting\sfor\sthe\sdebugger\sto\sdisconnect...') + let l:matches=matchlist(a:line,'\vdebug\>.............\<\sWaiting\sfor\sthe\sdebugger\sto\sdisconnect...|Error:\sThis\ssocket\shas\sbeen\sended\sby\sthe\sother\sparty') if 13 + let s:programEvalMode=0 + let l:expression=s:programEvalModeExpression + let l:value=a:line let a:readResult.std.evaluatedExpression={ - \'id':(l:id), \'expression':(l:expression), \'value':(l:value)} endif endif endfunction -" function! vebugger#ninspect#_removeAfterDisplayed(writeAction,debugger) -" for l:removeAction in a:writeAction -" if has_key(l:removeAction,'id') -" call a:debugger.writeLine('undisplay '.l:removeAction.id) -" endif -" endfor -" endfunction - -" function! s:unescapeString(str) -" let l:result=a:str -" let l:result=substitute(l:result,'\\"','"','g') -" let l:result=substitute(l:result,'\\t',"\t",'g') -" return l:result -" endfunction +function! s:unescapeString(str) + let l:result=a:str + let l:result=substitute(l:result,'\\n','\r','g') + let l:result=substitute(l:result,'[0-9]*m','','g') + return l:result +endfunction