aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Anders <greg@gpanders.com>2017-08-26 17:29:12 -0500
committerJustin M. Keyes <justinkz@gmail.com>2017-09-09 15:56:51 +0200
commit7c00b10d8d99e9794e5e744c813164c45fc3c8b6 (patch)
treef3f0b77dea8e6b94308b3e52a99d67d97eee610a
parent26d08dfd0d9d2f8e3685a4fe083588519bd5dac0 (diff)
downloadrneovim-7c00b10d8d99e9794e5e744c813164c45fc3c8b6.tar.gz
rneovim-7c00b10d8d99e9794e5e744c813164c45fc3c8b6.tar.bz2
rneovim-7c00b10d8d99e9794e5e744c813164c45fc3c8b6.zip
health.vim: always check pyenv if installed #7219
Always check for the presence of pyenv_root if pyenv is installed: if it is not set, we don't know if it was intentional. If it wasn't intentional, the warning is confusing (see #7176). closes #7176
-rw-r--r--runtime/autoload/health/provider.vim31
1 files changed, 17 insertions, 14 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 26db5b77b7..0eaa678459 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -239,7 +239,7 @@ function! s:check_python(version) abort
let pyname = 'python'.(a:version == 2 ? '' : '3')
let pyenv = resolve(exepath('pyenv'))
- let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
+ let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : ''
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
let host_prog_var = pyname.'_host_prog'
let loaded_var = 'g:loaded_'.pyname.'_provider'
@@ -251,6 +251,19 @@ function! s:check_python(version) abort
return
endif
+ if !empty(pyenv)
+ if empty(pyenv_root)
+ call health#report_warn(
+ \ 'pyenv was found, but $PYENV_ROOT is not set.',
+ \ ['Did you follow the final install instructions?',
+ \ 'If you use a shell "framework" like Prezto or Oh My Zsh, try without.',
+ \ 'Try a different shell (bash).']
+ \ )
+ else
+ call health#report_ok(printf('pyenv found: "%s"', pyenv))
+ endif
+ endif
+
if exists('g:'.host_prog_var)
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
endif
@@ -282,15 +295,6 @@ function! s:check_python(version) abort
endif
if !empty(pyenv)
- if empty(pyenv_root)
- call health#report_warn(
- \ 'pyenv was found, but $PYENV_ROOT is not set.',
- \ ['Did you follow the final install instructions?']
- \ )
- else
- call health#report_ok(printf('pyenv found: "%s"', pyenv))
- endif
-
let python_bin = s:trim(s:system([pyenv, 'which', pyname], '', 1))
if empty(python_bin)
@@ -320,9 +324,8 @@ function! s:check_python(version) abort
if python_bin =~# '\<shims\>'
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_bin), [
- \ 'The `pyenv` executable is not in $PATH,',
- \ 'Your pyenv installation is broken. You should set '
- \ . '`g:'.host_prog_var.'` to avoid surprises.',
+ \ '`pyenv` is not in $PATH, your pyenv installation is broken. '
+ \ .'Set `g:'.host_prog_var.'` to avoid surprises.',
\ ])
endif
endif
@@ -335,7 +338,7 @@ function! s:check_python(version) abort
call health#report_warn('pyenv is not set up optimally.', [
\ printf('Create a virtualenv specifically '
\ . 'for Neovim using pyenv, and set `g:%s`. This will avoid '
- \ . 'the need to install Neovim''s Python module in each '
+ \ . 'the need to install the Neovim Python module in each '
\ . 'version/virtualenv.', host_prog_var)
\ ])
elseif !empty(venv) && exists('g:'.host_prog_var)