mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 03:24:47 +08:00
vim: catch if get_definition is returning a keyword
This commit is contained in:
5
jedi.vim
5
jedi.vim
@@ -404,7 +404,10 @@ def _goto(is_definition=False, is_related_name=False, no_output=False):
|
|||||||
|
|
||||||
d = list(definitions)[0]
|
d = list(definitions)[0]
|
||||||
if d.in_builtin_module():
|
if d.in_builtin_module():
|
||||||
echo_highlight("Builtin modules cannot be displayed.")
|
if isinstance(d.definition, functions.keywords.Keyword):
|
||||||
|
echo_highlight("Cannot get the definition of Python keywords.")
|
||||||
|
else:
|
||||||
|
echo_highlight("Builtin modules cannot be displayed.")
|
||||||
else:
|
else:
|
||||||
if d.module_path != vim.current.buffer.name:
|
if d.module_path != vim.current.buffer.name:
|
||||||
if vim.eval('g:jedi#use_tabs_not_buffers') == '1':
|
if vim.eval('g:jedi#use_tabs_not_buffers') == '1':
|
||||||
|
|||||||
Reference in New Issue
Block a user