Add 'winwidth' split option

This commit is contained in:
petobens
2015-02-15 19:11:38 -03:00
parent bf4a8bfd5a
commit b71ef1176c
2 changed files with 6 additions and 2 deletions

View File

@@ -429,7 +429,7 @@ Default: 1
If you want to open new split for "go to", you could set this option to the If you want to open new split for "go to", you could set this option to the
direction which you want to open a split with. direction which you want to open a split with.
Options: top, left, right or bottom Options: top, left, right, bottom or winwidth
Default: "" (not enabled by default) Default: "" (not enabled by default)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

View File

@@ -469,8 +469,12 @@ def new_buffer(path, options=''):
'top': 'topleft split', 'top': 'topleft split',
'left': 'topleft vsplit', 'left': 'topleft vsplit',
'right': 'botright vsplit', 'right': 'botright vsplit',
'bottom': 'botright split' 'bottom': 'botright split',
'winwidth': 'vs'
} }
if user_split_option == 'winwidth' and vim.current.window.width <= 2 * int(vim_eval("&tw ? &tw : 80")):
for key, value in split_options.items():
split_options['winwidth'] = 'sp'
if user_split_option not in split_options: if user_split_option not in split_options:
print('g:jedi#use_splits_not_buffers value is not correct, valid options are: %s' % ','.join(split_options.keys())) print('g:jedi#use_splits_not_buffers value is not correct, valid options are: %s' % ','.join(split_options.keys()))
else: else: