Add options to control window sizes

This adds the following options, allowing the default sizes to be
overridden:

- g:vimspector_sidebar_width: Controls the width of the left utility
  windows (variables, watches, stack trace)
- g:vimspector_bottombar_height: Controls the height of the output
  window below the code window

The terminal is typically created as a vertical split of the code
window.  The following control the sizing of the terminal window used
for debuggee input/output when using Vim's built-in terminal.

- g:vimspector_code_minwidth: Minimum number of columns to try and
  maintain for the code window.
- g:vimspector_terminal_maxwidth: Maximum number of columns to use for
  th terminal, when vertically splitting the code window.
- g:vimspector_terminal_minwidth: Minimum number of columns to use when
  it is not possible to fit g:vimspector_terminal_maxwidth columns next
  to the code window with g:vimspector_code_minwidth columns.
This commit is contained in:
Ben Jackson 2020-07-17 16:52:41 +01:00
commit f8cbb7c5b6
3 changed files with 42 additions and 12 deletions

View file

@ -29,7 +29,8 @@ from vimspector import ( breakpoints,
output,
stack_trace,
utils,
variables )
variables,
settings )
from vimspector.vendor.json_minify import minify
# We cache this once, and don't allow it to change (FIXME?)
@ -487,7 +488,8 @@ class DebugSession( object ):
self._codeView = code.CodeView( code_window, self._api_prefix )
# Call stack
vim.command( 'topleft vertical 50new' )
vim.command(
f'topleft vertical { settings.Int( "sidebar_width", 50 ) }new' )
stack_trace_window = vim.current.window
one_third = int( vim.eval( 'winheight( 0 )' ) ) / 3
self._stackTraceView = stack_trace.StackTraceView( self,
@ -515,7 +517,7 @@ class DebugSession( object ):
# Output/logging
vim.current.window = code_window
vim.command( 'rightbelow 10new' )
vim.command( f'rightbelow { settings.Int( "bottombar_height", 10 ) }new' )
output_window = vim.current.window
self._outputView = output.OutputView( self._connection,
output_window,