From: Paul Ganssle
Date: Tue, 3 Mar 2020 12:00:52 +0000 (-0500)
Subject: Notify users of missing Python lazily (#1210)
X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/bbe5ae70c17ff16801fef240f49b707535c7f64c?ds=inline;hp=8fef74cf527d7fa5f2da78fafc61152c8766d0ad
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
---
diff --git a/plugin/black.vim b/plugin/black.vim
index a4047d4..8106ea1 100644
--- a/plugin/black.vim
+++ b/plugin/black.vim
@@ -14,7 +14,12 @@
" - restore cursor/window position after formatting
if v:version < 700 || !has('python3')
- echo "The black.vim plugin requires vim7.0+ with Python 3.6 support."
+ 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