Added toggling command for the log buffer

This commit is contained in:
IdanArye 2013-12-28 00:08:42 +02:00
parent 048e4a089a
commit 40f9e42735
2 changed files with 22 additions and 3 deletions

View File

@ -94,7 +94,7 @@ function! s:f_debugger.showLogBuffer() dict
setlocal buftype=nofile
setlocal bufhidden=wipe
let self.logBuffer=bufnr('')
file Vebugger\ Console
silent file Vebugger\ Console
wincmd p
endfunction
@ -109,6 +109,23 @@ function! s:f_debugger.closeLogBuffer() dict
endif
endfunction
function! s:f_debugger.isLogBufferOpen() dict
if has_key(self,'logBuffer')
if -1<bufwinnr(self.logBuffer)
return 1
endif
endif
return 0
endfunction
function! s:f_debugger.toggleLogBuffer() dict
if self.isLogBufferOpen()
call self.closeLogBuffer()
else
call self.showLogBuffer()
endif
endfunction
function! s:f_debugger.logLine(pipeName,line) dict
if has_key(self,'logBuffer')
let l:bufwin=bufwinnr(self.logBuffer)
@ -233,9 +250,9 @@ function! vebugger#invokeReading()
endif
endfunction
function! vebugger#showLogBuffer()
function! vebugger#toggleLogBuffer()
if exists('s:debugger')
call s:debugger.showLogBuffer()
call s:debugger.toggleLogBuffer()
endif
endfunction

View File

@ -6,3 +6,5 @@ command! -nargs=0 VBGstepIn call vebugger#setWriteActionAndPerform('std','flow',
command! -nargs=0 VBGstepOver call vebugger#setWriteActionAndPerform('std','flow','stepover')
command! -nargs=0 VBGstepOut call vebugger#setWriteActionAndPerform('std','flow','stepout')
command! -nargs=0 VBGcontinue call vebugger#setWriteActionAndPerform('std','flow','continue')
command! -nargs=0 VBGtoggleLogBuffer call vebugger#toggleLogBuffer()