If there isn't enough vertical space, we get vim errors (not enough room), so don't do that
This commit is contained in:
parent
01ea50cb70
commit
2615cff97a
2 changed files with 12 additions and 4 deletions
|
|
@ -657,8 +657,6 @@ class DebugSession( object ):
|
||||||
|
|
||||||
mode = settings.Get( 'ui_mode' )
|
mode = settings.Get( 'ui_mode' )
|
||||||
|
|
||||||
self._logger.debug( 'ui_mode = %s', mode )
|
|
||||||
|
|
||||||
if mode == 'auto':
|
if mode == 'auto':
|
||||||
# Go vertical if there isn't enough horizontal space for at least:
|
# Go vertical if there isn't enough horizontal space for at least:
|
||||||
# the left bar width
|
# the left bar width
|
||||||
|
|
@ -670,13 +668,23 @@ class DebugSession( object ):
|
||||||
+ settings.Int( 'code_minwidth' )
|
+ settings.Int( 'code_minwidth' )
|
||||||
+ 1 + settings.Int( 'terminal_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'
|
mode = ( 'vertical'
|
||||||
if vim.options[ 'columns' ] < min_width
|
if vim.options[ 'columns' ] < min_width
|
||||||
else 'horizontal' )
|
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_width,
|
||||||
|
min_height,
|
||||||
vim.options[ 'columns' ],
|
vim.options[ 'columns' ],
|
||||||
|
vim.options[ 'lines' ],
|
||||||
mode )
|
mode )
|
||||||
|
|
||||||
if mode == 'vertical':
|
if mode == 'vertical':
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ function! SetUp_Test_AutoLayoutTerminalVertVert()
|
||||||
" Not wide enough to go horizontal, but wide enough to put the terminal and
|
" Not wide enough to go horizontal, but wide enough to put the terminal and
|
||||||
" code vertically split
|
" code vertically split
|
||||||
call vimspector#test#setup#PushOption( 'columns', 80 )
|
call vimspector#test#setup#PushOption( 'columns', 80 )
|
||||||
call vimspector#test#setup#PushOption( 'lines', 30 )
|
call vimspector#test#setup#PushOption( 'lines', 50 )
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! Test_AutoLayoutTerminalVertVert()
|
function! Test_AutoLayoutTerminalVertVert()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue