If there isn't enough vertical space, we get vim errors (not enough room), so don't do that

This commit is contained in:
Ben Jackson 2021-03-11 21:14:30 +00:00
commit 2615cff97a
2 changed files with 12 additions and 4 deletions

View file

@ -657,8 +657,6 @@ class DebugSession( object ):
mode = settings.Get( 'ui_mode' )
self._logger.debug( 'ui_mode = %s', mode )
if mode == 'auto':
# Go vertical if there isn't enough horizontal space for at least:
# the left bar width
@ -670,13 +668,23 @@ class DebugSession( object ):
+ settings.Int( 'code_minwidth' )
+ 1 + settings.Int( 'terminal_minwidth' ) )
min_height = ( settings.Int( 'code_minheight' ) + 1 +
settings.Int( 'topbar_height' ) + 1 +
settings.Int( 'bottombar_height' ) + 1 +
2 )
mode = ( 'vertical'
if vim.options[ 'columns' ] < min_width
else 'horizontal' )
self._logger.debug( 'min_width: %s, actual: %s - result: %s',
if vim.options[ 'lines' ] < min_height:
mode = 'horizontal'
self._logger.debug( 'min_width/height: %s/%s, actual: %s/%s - result: %s',
min_width,
min_height,
vim.options[ 'columns' ],
vim.options[ 'lines' ],
mode )
if mode == 'vertical':

View file

@ -256,7 +256,7 @@ function! SetUp_Test_AutoLayoutTerminalVertVert()
" Not wide enough to go horizontal, but wide enough to put the terminal and
" code vertically split
call vimspector#test#setup#PushOption( 'columns', 80 )
call vimspector#test#setup#PushOption( 'lines', 30 )
call vimspector#test#setup#PushOption( 'lines', 50 )
endfunction
function! Test_AutoLayoutTerminalVertVert()