mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 10:54:22 +08:00
Fix goto() deprecation.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user