Documentation for the UI customisation
This commit is contained in:
parent
80afb153b9
commit
3726766694
4 changed files with 180 additions and 1 deletions
|
|
@ -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 ):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue