aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-12-29 18:35:05 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-12-29 18:45:21 +0100
commit5563e808da545fb931f5a7fd7c2d391cfc6e21ca (patch)
treeb2003384e6242571a0b5588cb741754c2a7edb8f
parent49f4358b0aced154565ed4cfe86a136853cc1829 (diff)
downloadrneovim-5563e808da545fb931f5a7fd7c2d391cfc6e21ca.tar.gz
rneovim-5563e808da545fb931f5a7fd7c2d391cfc6e21ca.tar.bz2
rneovim-5563e808da545fb931f5a7fd7c2d391cfc6e21ca.zip
health.vim: fix $VIRTUAL_ENV validation
Check that the full path to the python interpreter starts with $VIRTUAL_ENV. closes #7770
-rw-r--r--runtime/autoload/health/provider.vim16
1 files changed, 2 insertions, 14 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 83dee043a0..d1239db605 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -370,21 +370,9 @@ function! s:check_python(version) abort
let python_bin = ''
endif
-
- " Check if $VIRTUAL_ENV is active.
+ " Check if $VIRTUAL_ENV is valid.
if exists('$VIRTUAL_ENV')
- let virtualenv_inactive = 0
-
- if !empty(pyenv)
- let pyenv_prefix = resolve(s:trim(s:system([pyenv, 'prefix'])))
- if $VIRTUAL_ENV != pyenv_prefix
- let virtualenv_inactive = 1
- endif
- elseif !empty(pyname) && exepath(pyname) !~# '^'.$VIRTUAL_ENV.'/'
- let virtualenv_inactive = 1
- endif
-
- if virtualenv_inactive
+ if !empty(pyname) && $VIRTUAL_ENV !=# matchstr(exepath(pyname), '^\V'.$VIRTUAL_ENV)
call health#report_warn(
\ '$VIRTUAL_ENV exists but appears to be inactive. '
\ . 'This could lead to unexpected results.',