From 17aa6e48d3765bee27fcd7293b2d556754417e77 Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 12 Sep 2012 12:27:32 +0200 Subject: [PATCH] vim: catch if get_definition is returning a keyword --- jedi.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jedi.vim b/jedi.vim index 0244bd5..3ae887a 100644 --- a/jedi.vim +++ b/jedi.vim @@ -404,7 +404,10 @@ def _goto(is_definition=False, is_related_name=False, no_output=False): d = list(definitions)[0] 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: if d.module_path != vim.current.buffer.name: if vim.eval('g:jedi#use_tabs_not_buffers') == '1':