Fix goto() deprecation.

This commit is contained in:
heavenshell
2013-06-01 00:47:11 +09:00
parent e4a2a0f30e
commit 355203cab0

View File

@@ -109,7 +109,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False):
elif is_definition: elif is_definition:
definitions = script.goto_definitions() definitions = script.goto_definitions()
else: else:
definitions = script.goto() definitions = script.goto_assignments()
except jedi.NotFoundError: except jedi.NotFoundError:
echo_highlight( echo_highlight(
"Cannot follow nothing. Put your cursor on a valid name.") "Cannot follow nothing. Put your cursor on a valid name.")
@@ -139,7 +139,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False):
if d.module_path != vim.current.buffer.name: if d.module_path != vim.current.buffer.name:
vim.eval('jedi#new_buffer(%s)' % \ vim.eval('jedi#new_buffer(%s)' % \
repr(PythonToVimStr(d.module_path))) repr(PythonToVimStr(d.module_path)))
vim.current.window.cursor = d.line_nr, d.column vim.current.window.cursor = d.line, d.column
vim.command('normal! zt') # cursor at top of screen vim.command('normal! zt') # cursor at top of screen
else: else:
# multiple solutions # multiple solutions