Merge pull request #461 from blueyed/importerror-with-no_jedi_warning

Pass ImportError to no_jedi_warning and display it there
This commit is contained in:
Dave Halter
2015-09-08 16:42:38 +02:00

View File

@@ -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: