Notify users of missing Python lazily (#1210)

Currently this message shows up with no context prior to the start of
Vim. By changing this to a lazy message, the user will only be notified
of a problem with the Black plugin when they are attempting to use the
Black plugin.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Paul Ganssle 2020-03-03 07:00:52 -05:00 committed by GitHub
parent 8fef74cf52
commit bbe5ae70c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,12 @@
" - restore cursor/window position after formatting
if v:version < 700 || !has('python3')
func! __BLACK_MISSING()
echo "The black.vim plugin requires vim7.0+ with Python 3.6 support."
endfunc
command! Black :call __BLACK_MISSING()
command! BlackUpgrade :call __BLACK_MISSING()
command! BlackVersion :call __BLACK_MISSING()
finish
endif