From b71ef1176ce6ac3d701688ba666affe744e235cb Mon Sep 17 00:00:00 2001 From: petobens Date: Sun, 15 Feb 2015 19:11:38 -0300 Subject: [PATCH] Add 'winwidth' split option --- doc/jedi-vim.txt | 2 +- jedi_vim.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/jedi-vim.txt b/doc/jedi-vim.txt index c8cf04d..bf40d7a 100644 --- a/doc/jedi-vim.txt +++ b/doc/jedi-vim.txt @@ -429,7 +429,7 @@ Default: 1 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. -Options: top, left, right or bottom +Options: top, left, right, bottom or winwidth Default: "" (not enabled by default) ------------------------------------------------------------------------------ diff --git a/jedi_vim.py b/jedi_vim.py index 7c5ed13..abcf648 100644 --- a/jedi_vim.py +++ b/jedi_vim.py @@ -469,8 +469,12 @@ def new_buffer(path, options=''): 'top': 'topleft split', 'left': 'topleft 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: print('g:jedi#use_splits_not_buffers value is not correct, valid options are: %s' % ','.join(split_options.keys())) else: