X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2ec4c5f4f90838ba4b63e2edda63ccf261849177..ae8ea510e3078c929e92257f1809e4760c540d87:/plugin/black.vim?ds=sidebyside diff --git a/plugin/black.vim b/plugin/black.vim index df033e6..34f30c5 100644 --- a/plugin/black.vim +++ b/plugin/black.vim @@ -102,6 +102,8 @@ def Black(): mode = black.FileMode.AUTO_DETECT if bool(int(vim.eval("g:black_skip_string_normalization"))): mode |= black.FileMode.NO_STRING_NORMALIZATION + if vim.current.buffer.name.endswith('.pyi'): + mode |= black.FileMode.PYI buffer_str = '\n'.join(vim.current.buffer) + '\n' try: new_buffer_str = black.format_file_contents(buffer_str, line_length=line_length, fast=fast, mode=mode) @@ -126,6 +128,3 @@ endpython3 command! Black :py3 Black() command! BlackUpgrade :py3 BlackUpgrade() command! BlackVersion :py3 BlackVersion() - -nmap ,= :Black -vmap ,= :Black