Fix / improve report messages (#12396)

This commit is contained in:
David Lukes
2020-07-19 22:37:50 +02:00
committed by GitHub
parent e1d1c413f7
commit 33837745bb

View File

@@ -537,8 +537,8 @@ function! s:check_virtualenv() abort
call add(errors, 'no Python executables found in the virtualenv '.bin_dir.' directory.') call add(errors, 'no Python executables found in the virtualenv '.bin_dir.' directory.')
endif endif
let msg = '$VIRTUAL_ENV is set to: '.$VIRTUAL_ENV
if len(errors) if len(errors)
let msg = '$VIRTUAL_ENV is set to: '.$VIRTUAL_ENV
if len(venv_bins) if len(venv_bins)
let msg .= "\nAnd its ".bin_dir.' directory contains: ' let msg .= "\nAnd its ".bin_dir.' directory contains: '
\.join(map(venv_bins, "fnamemodify(v:val, ':t')"), ', ') \.join(map(venv_bins, "fnamemodify(v:val, ':t')"), ', ')
@@ -551,7 +551,10 @@ function! s:check_virtualenv() abort
let msg .= "\nSo invoking Python may lead to unexpected results." let msg .= "\nSo invoking Python may lead to unexpected results."
call health#report_warn(msg, keys(hints)) call health#report_warn(msg, keys(hints))
else else
call health#report_ok('$VIRTUAL_ENV provides :python, :python3, et al.') call health#report_info(msg)
call health#report_info('Python version: '
\.system('python -c "import platform, sys; sys.stdout.write(platform.python_version())"'))
call health#report_ok('$VIRTUAL_ENV provides :!python.')
endif endif
endfunction endfunction