File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -370,10 +370,11 @@ function! s:check_python(version) abort
370370 let python_bin = ' '
371371 endif
372372
373- " Check if $VIRTUAL_ENV is active
374- let virtualenv_inactive = 0
375373
374+ " Check if $VIRTUAL_ENV is active.
376375 if exists (' $VIRTUAL_ENV' )
376+ let virtualenv_inactive = 0
377+
377378 if ! empty (pyenv)
378379 let pyenv_prefix = resolve (s: trim (s: system ([pyenv, ' prefix' ])))
379380 if $VIRTUAL_ENV != pyenv_prefix
@@ -382,13 +383,13 @@ function! s:check_python(version) abort
382383 elseif ! empty (pyname) && exepath (pyname) !~# ' ^' .$VIRTUAL_ENV .' /'
383384 let virtualenv_inactive = 1
384385 endif
385- endif
386386
387- if virtualenv_inactive
388- call health#report_warn (
389- \ ' $VIRTUAL_ENV exists but appears to be inactive. '
390- \ . ' This could lead to unexpected results.' ,
391- \ [ ' If you are using Zsh, see: http://vi.stackexchange.com/a/7654/5229' ])
387+ if virtualenv_inactive
388+ call health#report_warn (
389+ \ ' $VIRTUAL_ENV exists but appears to be inactive. '
390+ \ . ' This could lead to unexpected results.' ,
391+ \ [ ' If you are using Zsh, see: http://vi.stackexchange.com/a/7654' ])
392+ endif
392393 endif
393394
394395 " Diagnostic output
You can’t perform that action at this time.
0 commit comments