forked from VimPlug/jedi-vim
added split support for goto action
This commit is contained in:
@@ -221,6 +221,7 @@ endfor
|
||||
|
||||
let s:settings = {
|
||||
\ 'use_tabs_not_buffers': 1,
|
||||
\ 'use_splits_not_buffers': "",
|
||||
\ 'auto_initialization': 1,
|
||||
\ 'auto_vim_configuration': 1,
|
||||
\ 'goto_assignments_command': "'<leader>g'",
|
||||
|
||||
@@ -37,6 +37,7 @@ Contents *jedi-vim-contents*
|
||||
6.7. use_tabs_not_buffers |g:jedi#use_tabs_not_buffers|
|
||||
6.8. squelch_py_warning |g:jedi#squelch_py_warning|
|
||||
6.9. completions_enable |g:jedi#completions_enable|
|
||||
6.10. use_splits_not_buffers |g:jedi#user_splits_not_buffers|
|
||||
7. Testing |jedi-vim-testing|
|
||||
8. Contributing |jedi-vim-contributing|
|
||||
9. License |jedi-vim-license|
|
||||
@@ -394,6 +395,15 @@ YCM).
|
||||
Options: 0 or 1
|
||||
Default: 1
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
6.9. `g:jedi#completions_enable` *g:jedi#completions_enable*
|
||||
|
||||
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
|
||||
Default: "" (not enabled by default)
|
||||
|
||||
==============================================================================
|
||||
7. Testing *jedi-vim-testing*
|
||||
|
||||
|
||||
18
jedi_vim.py
18
jedi_vim.py
@@ -399,6 +399,24 @@ def new_buffer(path, options=''):
|
||||
# options are what you can to edit the edit options
|
||||
if vim_eval('g:jedi#use_tabs_not_buffers') == '1':
|
||||
_tabnew(path, options)
|
||||
elif vim_eval('g:jedi#use_splits_not_buffers'):
|
||||
user_split_option = vim_eval('g:jedi#use_splits_not_buffers')
|
||||
split_options = [
|
||||
'top',
|
||||
'right',
|
||||
'left',
|
||||
'bottom'
|
||||
]
|
||||
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))
|
||||
else:
|
||||
VIM_SPLIT_COMMAND = {
|
||||
'top': 'topleft split',
|
||||
'left': 'topleft vsplit',
|
||||
'right': 'botright vsplit',
|
||||
'bottom': 'botright split'
|
||||
}
|
||||
vim_command(VIM_SPLIT_COMMAND[user_split_option] + " %s" % path)
|
||||
else:
|
||||
if vim_eval("!&hidden && &modified") == '1':
|
||||
if vim_eval("bufname('%')") is None:
|
||||
|
||||
Reference in New Issue
Block a user