X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/5446a92f0161e398de765bf9532d8c76c5652333..3cb010ec8ec02392dee5073b74e6eff80030c5f0:/plugin/black.vim diff --git a/plugin/black.vim b/plugin/black.vim index b5edb2a..90d2047 100644 --- a/plugin/black.vim +++ b/plugin/black.vim @@ -43,18 +43,30 @@ endif if !exists("g:black_linelength") let g:black_linelength = 88 endif -if !exists("g:black_string_normalization") - if exists("g:black_skip_string_normalization") - let g:black_string_normalization = !g:black_skip_string_normalization +if !exists("g:black_skip_string_normalization") + if exists("g:black_string_normalization") + let g:black_skip_string_normalization = !g:black_string_normalization else - let g:black_string_normalization = 1 + let g:black_skip_string_normalization = 0 endif endif if !exists("g:black_quiet") let g:black_quiet = 0 endif +if !exists("g:black_target_version") + let g:black_target_version = "" +endif +function BlackComplete(ArgLead, CmdLine, CursorPos) + return [ +\ 'target_version=py27', +\ 'target_version=py36', +\ 'target_version=py37', +\ 'target_version=py38', +\ 'target_version=py39', +\ ] +endfunction -command! Black :call black#Black() +command! -nargs=* -complete=customlist,BlackComplete Black :call black#Black() command! BlackUpgrade :call black#BlackUpgrade() command! BlackVersion :call black#BlackVersion()