Some minor fixes

This commit is contained in:
IdanArye 2014-05-14 21:52:55 +03:00
parent ac5be406e9
commit d0d7fd827e
3 changed files with 24 additions and 28 deletions

View File

@ -53,7 +53,7 @@ function! s:f_debugger.invokeReading() dict
endfunction endfunction
function! s:f_debugger.handleLine(pipeName,line) dict function! s:f_debugger.handleLine(pipeName,line) dict
call self.logLine(a:pipeName,a:line) call self.addLineToTerminal(a:pipeName,a:line)
let l:readResult=deepcopy(self.readResultTemplate,1) let l:readResult=deepcopy(self.readResultTemplate,1)
@ -84,24 +84,24 @@ function! s:f_debugger.performWriteActions() dict
call self.generateWriteActionsFromTemplate() call self.generateWriteActionsFromTemplate()
endfunction endfunction
function! s:f_debugger.showLogBuffer() dict function! s:f_debugger.showTerminalBuffer() dict
if has_key(self,'logBuffer') if has_key(self,'terminalBuffer')
if -1<bufwinnr(self.logBuffer) if -1<bufwinnr(self.terminalBuffer)
return return
endif endif
endif endif
new new
setlocal buftype=nofile setlocal buftype=nofile
setlocal bufhidden=wipe setlocal bufhidden=wipe
let self.logBuffer=bufnr('') let self.terminalBuffer=bufnr('')
silent file Vebugger\ Console silent file Vebugger\ Console
wincmd p wincmd p
endfunction endfunction
function! s:f_debugger.closeLogBuffer() dict function! s:f_debugger.closeTerminalBuffer() dict
if has_key(self,'logBuffer') if has_key(self,'terminalBuffer')
if -1<bufwinnr(self.logBuffer) if -1<bufwinnr(self.terminalBuffer)
let l:bufwin=bufwinnr(self.logBuffer) let l:bufwin=bufwinnr(self.terminalBuffer)
exe l:bufwin.'wincmd w' exe l:bufwin.'wincmd w'
wincmd c wincmd c
wincmd p wincmd p
@ -109,26 +109,26 @@ function! s:f_debugger.closeLogBuffer() dict
endif endif
endfunction endfunction
function! s:f_debugger.isLogBufferOpen() dict function! s:f_debugger.isTerminalBufferOpen() dict
if has_key(self,'logBuffer') if has_key(self,'terminalBuffer')
if -1<bufwinnr(self.logBuffer) if -1<bufwinnr(self.terminalBuffer)
return 1 return 1
endif endif
endif endif
return 0 return 0
endfunction endfunction
function! s:f_debugger.toggleLogBuffer() dict function! s:f_debugger.toggleTerminalBuffer() dict
if self.isLogBufferOpen() if self.isTerminalBufferOpen()
call self.closeLogBuffer() call self.closeTerminalBuffer()
else else
call self.showLogBuffer() call self.showTerminalBuffer()
endif endif
endfunction endfunction
function! s:f_debugger.logLine(pipeName,line) dict function! s:f_debugger.addLineToTerminal(pipeName,line) dict
if has_key(self,'logBuffer') if has_key(self,'terminalBuffer')
let l:bufwin=bufwinnr(self.logBuffer) let l:bufwin=bufwinnr(self.terminalBuffer)
if -1<l:bufwin if -1<l:bufwin
exe l:bufwin.'wincmd w' exe l:bufwin.'wincmd w'
if 'out'==a:pipeName if 'out'==a:pipeName
@ -237,7 +237,7 @@ function! vebugger#killDebugger()
autocmd! autocmd!
augroup END augroup END
if exists('s:debugger') if exists('s:debugger')
call s:debugger.closeLogBuffer() call s:debugger.closeTerminalBuffer()
call s:debugger.kill() call s:debugger.kill()
unlet s:debugger unlet s:debugger
endif endif
@ -255,9 +255,9 @@ function! vebugger#invokeReading()
endif endif
endfunction endfunction
function! vebugger#toggleLogBuffer() function! vebugger#toggleTerminalBuffer()
if exists('s:debugger') if exists('s:debugger')
call s:debugger.toggleLogBuffer() call s:debugger.toggleTerminalBuffer()
endif endif
endfunction endfunction

View File

@ -5,8 +5,6 @@ function! vebugger#rdebug#start(entryFile,args)
\: 'ruby -rdebug') \: 'ruby -rdebug')
\.' '.a:entryFile) \.' '.a:entryFile)
let l:debugger.state.rdebug={} let l:debugger.state.rdebug={}
call l:debugger.showLogBuffer()
call l:debugger.addReadHandler(function('s:readWhere')) call l:debugger.addReadHandler(function('s:readWhere'))
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions')) call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
@ -20,8 +18,6 @@ function! vebugger#rdebug#start(entryFile,args)
call l:debugger.std_addAllBreakpointActions(g:vebugger_breakpoints) call l:debugger.std_addAllBreakpointActions(g:vebugger_breakpoints)
VBGtoggleLogBuffer
return l:debugger return l:debugger
endfunction endfunction

View File

@ -10,7 +10,7 @@ command! -nargs=0 VBGstepOver call vebugger#setWriteActionAndPerform('std','flow
command! -nargs=0 VBGstepOut call vebugger#setWriteActionAndPerform('std','flow','stepout') command! -nargs=0 VBGstepOut call vebugger#setWriteActionAndPerform('std','flow','stepout')
command! -nargs=0 VBGcontinue call vebugger#setWriteActionAndPerform('std','flow','continue') command! -nargs=0 VBGcontinue call vebugger#setWriteActionAndPerform('std','flow','continue')
command! -nargs=0 VBGtoggleLogBuffer call vebugger#toggleLogBuffer() command! -nargs=0 VBGtoggleTerminalBuffer call vebugger#toggleTerminalBuffer()
command! -nargs=+ VBGtoggleBreakpoint call vebugger#std#toggleBreakpoint(<f-args>) command! -nargs=+ VBGtoggleBreakpoint call vebugger#std#toggleBreakpoint(<f-args>)
command! -nargs=0 VBGtoggleBreakpointThisLine call vebugger#std#toggleBreakpoint(expand('%:~:.'),line('.')) command! -nargs=0 VBGtoggleBreakpointThisLine call vebugger#std#toggleBreakpoint(expand('%:~:.'),line('.'))
command! -nargs=0 VBGclearBreakpints call vebugger#std#clearBreakpoints() command! -nargs=0 VBGclearBreakpints call vebugger#std#clearBreakpoints()
@ -39,7 +39,7 @@ if exists('g:vebugger_leader')
\'o':'VBGstepOver', \'o':'VBGstepOver',
\'O':'VBGstepOut', \'O':'VBGstepOut',
\'c':'VBGcontinue', \'c':'VBGcontinue',
\'l':'VBGtoggleLogBuffer', \'t':'VBGtoggleTerminalBuffer',
\'b':'VBGtoggleBreakpointThisLine', \'b':'VBGtoggleBreakpointThisLine',
\'e':'VBGevalWordUnderCursor'}) \'e':'VBGevalWordUnderCursor'})
exe 'nnoremap '.g:vebugger_leader.s:mapping[0].' :'.s:mapping[1].'<Cr>' exe 'nnoremap '.g:vebugger_leader.s:mapping[0].' :'.s:mapping[1].'<Cr>'