Try and be a bit smarter in auto mode
This commit is contained in:
parent
5c8143a710
commit
251a0ff314
2 changed files with 16 additions and 2 deletions
|
|
@ -664,7 +664,19 @@ class DebugSession( object ):
|
||||||
mode = settings.Get( 'ui_mode' )
|
mode = settings.Get( 'ui_mode' )
|
||||||
|
|
||||||
if mode == 'auto':
|
if mode == 'auto':
|
||||||
mode = 'vertical' if vim.options[ 'columns' ] < 160 else 'horizontal'
|
# Go vertical if there isn't enough horizontal space for at least:
|
||||||
|
# the left bar width
|
||||||
|
# + the code min width
|
||||||
|
# + the terminal min width
|
||||||
|
# + enough space for a sign column and number column?
|
||||||
|
min_width = ( settings.Int( 'sidebar_width' )
|
||||||
|
+ 1 + 2 + 3
|
||||||
|
+ settings.Int( 'code_minwidth' )
|
||||||
|
+ 1 + settings.Int( 'terminal_minwidth' ) )
|
||||||
|
|
||||||
|
mode = ( 'vertical'
|
||||||
|
if vim.options[ 'columns' ] < min_width
|
||||||
|
else 'horizontal' )
|
||||||
|
|
||||||
if mode == 'vertical':
|
if mode == 'vertical':
|
||||||
self._SetUpUIVertical()
|
self._SetUpUIVertical()
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@ def LaunchTerminal( api_prefix,
|
||||||
# (this gives more vertical space, which becomes at at premium)
|
# (this gives more vertical space, which becomes at at premium)
|
||||||
vim.vars[ 'vimspector_session_windows' ][ 'mode' ] == 'horizontal' or
|
vim.vars[ 'vimspector_session_windows' ][ 'mode' ] == 'horizontal' or
|
||||||
vim.options[ 'columns' ] >= (
|
vim.options[ 'columns' ] >= (
|
||||||
settings.Int( 'terminal_maxwidth' ) + settings.Int( 'code_minwidth' )
|
settings.Int( 'terminal_maxwidth' ) +
|
||||||
|
settings.Int( 'code_minwidth' ) +
|
||||||
|
1 # for the split decoration
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'norestore': 1,
|
'norestore': 1,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue