mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-24 19:24:38 +08:00
a function to check if the definition is in a builtin module
This commit is contained in:
15
jedi.vim
15
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.")
|
||||
|
||||
Reference in New Issue
Block a user