X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/8fef74cf527d7fa5f2da78fafc61152c8766d0ad..81bf9bb961179cb3bddb1b93f5e52b0e22696096:/plugin/black.vim diff --git a/plugin/black.vim b/plugin/black.vim index a4047d4..9978e6c 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 @@ -40,7 +45,7 @@ if !exists("g:black_skip_string_normalization") let g:black_skip_string_normalization = 0 endif -python3 << endpython3 +python3 << EndPython3 import collections import os import sys @@ -186,7 +191,7 @@ def BlackUpgrade(): def BlackVersion(): print(f'Black, version {black.__version__} on Python {sys.version}.') -endpython3 +EndPython3 command! Black :py3 Black() command! BlackUpgrade :py3 BlackUpgrade()