aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)