Tidy up the buffers and don't switch on new

This commit is contained in:
Ben Jackson 2018-05-28 15:48:51 +01:00
commit 9e0b68330e
2 changed files with 9 additions and 1 deletions

View file

@ -149,6 +149,7 @@ class DebugSession( object ):
if self._uiTab:
self._stackTraceView.Reset()
self._variablesView.Reset()
self._outputView.Reset()
vim.current.tabpage = self._uiTab
vim.command( 'tabclose' )

View file

@ -34,9 +34,14 @@ class OutputView( object ):
with utils.ModifiableScratchBuffer( self._buffers[ category ] ):
self._buffers[ category ].append( event[ 'output' ].splitlines() )
def Reset( self ):
self.Clear()
def Clear( self ):
for buf in self._buffers:
self._buffers[ buf ] = None
vim.command( 'bwipeout! {0}'.format( self._buffers[ buf ].name ) )
self._buffers.clear()
def ShowOutput( self, category ):
vim.current.window = self._window
@ -56,3 +61,5 @@ class OutputView( object ):
vim.command( "nnoremenu WinBar.{0} "
":call vimspector#ShowOutput( '{0}' )<CR>".format(
utils.Escape( category ) ) )
vim.command( 'bu #' )