Documentation for the UI customisation

This commit is contained in:
Ben Jackson 2020-07-18 13:41:22 +01:00
commit 3726766694
4 changed files with 180 additions and 1 deletions

View file

@ -453,6 +453,11 @@ class DebugSession( object ):
self._stackTraceView.ExpandFrameOrThread()
def ShowOutput( self, category ):
if not self._outputView.WindowIsValid():
with utils.LetCurrentTabpage( self._uiTab ):
vim.command( f'botright { settings.Int( "bottombar_height", 10 ) }new' )
self._outputView.UseWindow( vim.current.window )
self._outputView.ShowOutput( category )
def GetOutputBuffers( self ):

View file

@ -102,6 +102,17 @@ class OutputView( object ):
# FIXME: nunmenu the WinBar ?
self._buffers = {}
def WindowIsValid( self ):
return self._window.valid
def UseWindow( self, win ):
assert not self._window.valid
self._window = win
# TODO: Sorting of the WinBar ?
for category, _ in self._buffers.items():
self._RenderWinBar( category )
def _ShowOutput( self, category ):
if not self._window.valid:
return

View file

@ -214,6 +214,13 @@ def AnyWindowForBuffer( buf ):
yield
@contextlib.contextmanager
def LetCurrentTabpage( tabpage ):
with RestoreCurrentWindow():
vim.current.tabpage = tabpage
yield
@contextlib.contextmanager
def LetCurrentWindow( window ):
with RestoreCurrentWindow():