mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 11:14:32 +08:00
Pass ImportError to no_jedi_warning and display it there
Ref: https://github.com/davidhalter/jedi-vim/issues/460
This commit is contained in:
@@ -72,7 +72,10 @@ def vim_eval(string):
|
|||||||
return _catch_exception(string, 1)
|
return _catch_exception(string, 1)
|
||||||
|
|
||||||
|
|
||||||
def no_jedi_warning():
|
def no_jedi_warning(error=None):
|
||||||
|
msg = "Please install Jedi if you want to use jedi-vim."
|
||||||
|
if error:
|
||||||
|
msg = '{} The error was: {}'.format(msg, error)
|
||||||
vim.command('echohl WarningMsg'
|
vim.command('echohl WarningMsg'
|
||||||
'| echom "Please install Jedi if you want to use jedi-vim."'
|
'| echom "Please install Jedi if you want to use jedi-vim."'
|
||||||
'| echohl None')
|
'| echohl None')
|
||||||
@@ -86,8 +89,8 @@ def echo_highlight(msg):
|
|||||||
import vim
|
import vim
|
||||||
try:
|
try:
|
||||||
import jedi
|
import jedi
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
no_jedi_warning()
|
no_jedi_warning(str(e))
|
||||||
jedi = None
|
jedi = None
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user