From 26422a0db24ea5aede6f0254fb3755ec927c16fa Mon Sep 17 00:00:00 2001 From: David Halter Date: Sat, 28 Jul 2012 22:09:19 +0200 Subject: [PATCH] a function to check if the definition is in a builtin module --- jedi.vim | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/jedi.vim b/jedi.vim index 2898277..1a65bfd 100644 --- a/jedi.vim +++ b/jedi.vim @@ -98,12 +98,15 @@ if 1: vim.command('normal! m`') d = definitions[0] - if d.module_path != vim.current.buffer.name: - if vim.eval('g:jedi#use_tabs_not_buffers') == '1': - vim.command('call jedi#tabnew("%s")' % d.module_path) - else: - vim.command('edit ' + d.module_path) - vim.current.window.cursor = d.line_nr, d.column + if d.in_builtin_module(): + 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': + vim.command('call jedi#tabnew("%s")' % d.module_path) + else: + vim.command('edit ' + d.module_path) + vim.current.window.cursor = d.line_nr, d.column else: # multiple solutions echo_highlight("Multiple solutions: Not implemented yet.")