removed star import of jedi_vim

This commit is contained in:
David Halter
2012-10-13 01:32:30 +02:00
parent 6c21cb1520
commit 8a04fde301
2 changed files with 15 additions and 17 deletions

View File

@@ -2,38 +2,38 @@
" functions that call python code " functions that call python code
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
function! jedi#goto() function! jedi#goto()
python goto() python jedi_vim.goto()
endfunction endfunction
function! jedi#get_definition() function! jedi#get_definition()
python goto(is_definition=True) python jedi_vim.goto(is_definition=True)
endfunction endfunction
function! jedi#related_names() function! jedi#related_names()
python goto(is_related_name=True) python jedi_vim.goto(is_related_name=True)
endfunction endfunction
function! jedi#rename(...) function! jedi#rename(...)
python rename() python jedi_vim.rename()
endfunction endfunction
function! jedi#complete(findstart, base) function! jedi#complete(findstart, base)
python complete() python jedi_vim.complete()
endfunction endfunction
function jedi#show_func_def() function jedi#show_func_def()
python show_func_def(get_script().get_in_function_call()) python jedi_vim.show_func_def(jedi_vim.get_script().get_in_function_call())
return '' return ''
endfunction endfunction
function jedi#clear_func_def() function jedi#clear_func_def()
python clear_func_def() python jedi_vim.clear_func_def()
endfunction endfunction
@@ -43,10 +43,10 @@ endfunction
function! jedi#show_pydoc() function! jedi#show_pydoc()
python << PYTHONEOF python << PYTHONEOF
if 1: if 1:
script = get_script() script = jedi_vim.get_script()
try: try:
definitions = script.get_definition() definitions = script.get_definition()
except jedi.NotFoundError: except jedi_vim.jedi.NotFoundError:
definitions = [] definitions = []
except Exception: except Exception:
# print to stdout, will be in :messages # print to stdout, will be in :messages
@@ -60,7 +60,7 @@ if 1:
docs = ['Docstring for %s\n%s\n%s' % (d.desc_with_module, '='*40, d.doc) if d.doc docs = ['Docstring for %s\n%s\n%s' % (d.desc_with_module, '='*40, d.doc) if d.doc
else '|No Docstring for %s|' % d for d in definitions] else '|No Docstring for %s|' % d for d in definitions]
text = ('\n' + '-' * 79 + '\n').join(docs) text = ('\n' + '-' * 79 + '\n').join(docs)
vim.command('let l:doc = %s' % repr(PythonToVimStr(text))) vim.command('let l:doc = %s' % repr(jedi_vim.PythonToVimStr(text)))
vim.command('let l:doc_lines = %s' % len(text.split('\n'))) vim.command('let l:doc_lines = %s' % len(text.split('\n')))
PYTHONEOF PYTHONEOF
if bufnr("__doc__") > 0 if bufnr("__doc__") > 0
@@ -105,7 +105,7 @@ endfunction
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
function! jedi#new_buffer(path) function! jedi#new_buffer(path)
if g:jedi#use_tabs_not_buffers if g:jedi#use_tabs_not_buffers
python tabnew(vim.eval('a:path')) python jedi_vim.tabnew(vim.eval('a:path'))
else else
if !&hidden && &modified if !&hidden && &modified
w w
@@ -133,7 +133,7 @@ function! jedi#goto_window_on_enter()
if l:data.bufnr if l:data.bufnr
" close goto_window buffer " close goto_window buffer
normal ZQ normal ZQ
python tabnew(vim.eval("bufname(l:data.bufnr)")) python jedi_vim.tabnew(vim.eval("bufname(l:data.bufnr)"))
call cursor(l:data.lnum, l:data.col) call cursor(l:data.lnum, l:data.col)
else else
echohl WarningMsg | echo "Builtin module cannot be opened." | echohl None echohl WarningMsg | echo "Builtin module cannot be opened." | echohl None

View File

@@ -67,17 +67,15 @@ python << PYTHONEOF
""" here we initialize the jedi stuff """ """ here we initialize the jedi stuff """
import vim import vim
# update the system path, to include the python scripts # update the system path, to include the jedi path
import sys import sys
import os import os
from os.path import dirname, abspath, join from os.path import dirname, abspath, join
sys.path.insert(0, join(dirname(dirname(abspath(vim.eval('s:current_file')))), 'jedi')) sys.path.insert(0, join(dirname(dirname(abspath(vim.eval('s:current_file')))), 'jedi'))
import jedi # update the sys path to include the jedi_vim script
import jedi.keywords
sys.path.append(dirname(abspath(vim.eval('s:current_file')))) sys.path.append(dirname(abspath(vim.eval('s:current_file'))))
from jedi_vim import * import jedi_vim
sys.path.pop() sys.path.pop()
PYTHONEOF PYTHONEOF