diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-10-29 21:39:07 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-31 07:44:10 -0300 |
commit | 3fb5cdcb3f82cbcd345620a853602cf740b48d49 (patch) | |
tree | 3716f1790ebd339adaea3e7baeaeb5d07be39da4 | |
parent | 4b0f8f2a4d8f1f1db1900079061cad2098bf0ac0 (diff) | |
download | rneovim-3fb5cdcb3f82cbcd345620a853602cf740b48d49.tar.gz rneovim-3fb5cdcb3f82cbcd345620a853602cf740b48d49.tar.bz2 rneovim-3fb5cdcb3f82cbcd345620a853602cf740b48d49.zip |
Fix python setup: Report errors.
No error indication was being given if something went wrong while
setting up python.
-rw-r--r-- | runtime/plugin/python_setup.vim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/plugin/python_setup.vim b/runtime/plugin/python_setup.vim index 3a6c61bd1d..5cb2bb260f 100644 --- a/runtime/plugin/python_setup.vim +++ b/runtime/plugin/python_setup.vim @@ -4,6 +4,14 @@ if exists("did_python_setup") || &cp endif let did_python_setup = 1 +" Prefix for naming things and displaying output. +let s:plugin_name = 'Python setup' + +function! s:ShowError(message) + echohl ErrorMsg + echomsg s:plugin_name . ': ' . a:message . '.' + echohl None +endfunction let s:get_version = \ ' -c "import sys; sys.stdout.write(str(sys.version_info[0]) + '. @@ -24,6 +32,7 @@ elseif executable('python2') " In some distros, python3 is the default python let s:python_interpreter = 'python2' else + call s:ShowError('No python interpreter found') finish endif @@ -32,6 +41,7 @@ endif let s:import_result = system(s:python_interpreter . \ ' -c "import neovim, sys; sys.stdout.write(\"ok\")"') if s:import_result != 'ok' + call s:ShowError('No neovim module found') finish endif @@ -41,6 +51,6 @@ let s:pyhost_id = rpcstart(s:python_interpreter, " to block until all providers have been registered(or else some plugins loaded " by the user's vimrc would not get has('python') == 1 if rpcrequest(s:pyhost_id, 'python_eval', '"o"+"k"') != 'ok' || !has('python') - " Something went wrong + call s:ShowError('Something went wrong') call rpcstop(s:pyhost_id) endif |