Dont mess up other window placment

This commit is contained in:
Ben Jackson 2018-05-20 21:54:27 +01:00
commit 5a09914ee7

View file

@ -40,9 +40,7 @@ class DebugSession( object ):
self._SetUpUI() self._SetUpUI()
def _SetUpUI( self ): def _SetUpUI( self ):
# Code window # Code window
vim.command( 'tabnew' ) vim.command( 'tabnew' )
self._uiTab = vim.current.tabpage self._uiTab = vim.current.tabpage
@ -55,30 +53,31 @@ class DebugSession( object ):
vim.command( 'nnoremenu WinBar.Pause :call vimspector#Pause()<CR>' ) vim.command( 'nnoremenu WinBar.Pause :call vimspector#Pause()<CR>' )
# Threads # Threads
vim.command( 'vspl' ) vim.command( '50vspl' )
vim.command( 'enew' ) vim.command( 'enew' )
self._threadsBuffer = vim.current.buffer self._threadsBuffer = vim.current.buffer
utils.SetUpScratchBuffer( self._threadsBuffer ) utils.SetUpScratchBuffer( self._threadsBuffer )
with utils.TemporaryVimOption( 'equalalways', 1 ): with utils.TemporaryVimOption( 'eadirection', 'ver' ):
# Call stack with utils.TemporaryVimOption( 'equalalways', 1 ):
vim.command( 'spl' ) # Call stack
vim.command( 'enew' ) vim.command( 'spl' )
self._stackTraceView = stack_trace.StackTraceView( self, vim.command( 'enew' )
self._connection, self._stackTraceView = stack_trace.StackTraceView( self,
vim.current.buffer ) self._connection,
vim.current.buffer )
# Output/logging # Output/logging
vim.command( 'spl' ) vim.command( 'spl' )
vim.command( 'enew' ) vim.command( 'enew' )
self._outputBuffer = vim.current.buffer self._outputBuffer = vim.current.buffer
utils.SetUpScratchBuffer( self._outputBuffer ) utils.SetUpScratchBuffer( self._outputBuffer )
# Variables # Variables
vim.command( 'spl' ) vim.command( 'spl' )
vim.command( 'enew' ) vim.command( 'enew' )
self._variablesView = variables.VariablesView( self._connection, self._variablesView = variables.VariablesView( self._connection,
vim.current.buffer ) vim.current.buffer )
def SetCurrentFrame( self, frame ): def SetCurrentFrame( self, frame ):
@ -199,14 +198,12 @@ class DebugSession( object ):
'command': 'configurationDone', 'command': 'configurationDone',
} ) } )
def OnEvent_output( self, message ): def OnEvent_output( self, message ):
with utils.ModifiableScratchBuffer( self._outputBuffer ): with utils.ModifiableScratchBuffer( self._outputBuffer ):
t = [ message[ 'body' ][ 'category' ] + ':' + '-' * 20 ] t = [ message[ 'body' ][ 'category' ] + ':' + '-' * 20 ]
t += message[ 'body' ][ 'output' ].splitlines() t += message[ 'body' ][ 'output' ].splitlines()
self._outputBuffer.append( t, 0 ) self._outputBuffer.append( t, 0 )
def OnEvent_stopped( self, message ): def OnEvent_stopped( self, message ):
self._currentThread = message[ 'body' ][ 'threadId' ] self._currentThread = message[ 'body' ][ 'threadId' ]