diff --git a/jedi b/jedi index 80ec8da..2f3304b 160000 --- a/jedi +++ b/jedi @@ -1 +1 @@ -Subproject commit 80ec8da51398e1f69d57a4a5ba3dd3a153555868 +Subproject commit 2f3304b9f1fb2f58d9f9199dac71fd2c5a43cea0 diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 4d44fe5..399b1fc 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -79,8 +79,8 @@ if g:jedi#auto_initialization autocmd FileType Python setlocal omnifunc=jedi#completions switchbuf=useopen " needed for documentation/pydoc endif -fun! Pyimport(cmd, args) -py << EOF +fun! Pyimport(args) +Python << EOF # args are the same as for the :edit command # cmd: one of edit, split, vsplit, tabedit, ... if 1: @@ -99,12 +99,12 @@ if 1: path = None if path and osp.isfile(path): cmd_args = ' '.join([a.replace(' ', '\\ ') for a in args]) - vim.command('%s %s %s' % (cmd, cmd_args , path.replace(' ', '\ '))) + vim.eval("jedi#new_buffer('%s')" % path) EOF endfun -fun! Pyimport_comp(argl, cmdl, pos) -py << EOF +fun! Pyimport_completion(argl, cmdl, pos) +Python << EOF if 1: import vim import re @@ -124,8 +124,5 @@ EOF return comps endfun -command! -nargs=1 -complete=custom,Pyimport_comp Pyimport :call Pyimport('edit', ) -" command! -nargs=1 -complete=custom,Pyimport_comp Pysplit :call Pyimport('split', ) -" command! -nargs=1 -complete=custom,Pyimport_comp Pyvsplit :call Pyimport('vsplit', ) -" command! -nargs=1 -complete=custom,Pyimport_comp Pytabe :call Pyimport('tabe', ) +command! -nargs=1 -complete=custom,Pyimport_completion Pyimport :call Pyimport() " vim: set et ts=4: diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index c701074..1afff6e 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -75,8 +75,7 @@ def completions(): try: script = get_script(source=source, column=column) completions = script.completions() - sig = script.call_signatures() - call_def = sig[0] if sig else None + signatures = script.call_signatures() out = [] for c in completions: @@ -96,10 +95,10 @@ def completions(): print(traceback.format_exc()) strout = '' completions = [] - call_def = None + signatures = [] #print 'end', strout - show_call_signatures(call_def, len(completions)) + show_call_signatures(signatures, len(completions)) vim.command('return ' + strout) @@ -199,11 +198,11 @@ def clear_call_signatures(): vim.current.window.cursor = cursor -def show_call_signatures(call_def=None, completion_lines=0): +def show_call_signatures(signatures=()): if vim.eval("has('conceal') && g:jedi#show_call_signatures") == '0': return try: - if call_def == None: + if signatures == None: sig = get_script().call_signatures() call_def = sig[0] if sig else None clear_call_signatures()