diff --git a/pythonx/jedi_vim.py b/pythonx/jedi_vim.py index f0733bd..4dd89f0 100644 --- a/pythonx/jedi_vim.py +++ b/pythonx/jedi_vim.py @@ -293,10 +293,7 @@ def goto(mode="goto", no_output=False): """ script = get_script() if mode == "goto": - definitions = [x for x in script.goto_definitions() - if not x.in_builtin_module()] - if not definitions: - definitions = script.goto_assignments() + definitions = script.goto_assignments(follow_imports=True) elif mode == "related_name": definitions = script.usages() elif mode == "definition": diff --git a/test/goto.vim b/test/goto.vim index f4ef24d..8c96ef5 100644 --- a/test/goto.vim +++ b/test/goto.vim @@ -22,8 +22,8 @@ describe 'goto simple' it 'goto definitions' normal \d - Expect line('.') == 1 - Expect col('.') == 5 + Expect line('.') == 2 + Expect col('.') == 1 end it 'goto assignments'