Skip to content

Commit 2f3e001

Browse files
committed
health.vim: minor refactor (group related logic)
1 parent 341102f commit 2f3e001

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

runtime/autoload/health/provider.vim

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)