Skip to content

Commit

Permalink
add preview flag in vim plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
SyPeter committed Aug 31, 2022
1 parent 2c90480 commit 4f134f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autoload/black.vim
Expand Up @@ -30,6 +30,7 @@ FLAGS = [
Flag(name="skip_string_normalization", cast=strtobool),
Flag(name="quiet", cast=strtobool),
Flag(name="skip_magic_trailing_comma", cast=strtobool),
Flag(name="preview", cast=strtobool),
]


Expand Down Expand Up @@ -145,6 +146,7 @@ def Black(**kwargs):
string_normalization=not configs["skip_string_normalization"],
is_pyi=vim.current.buffer.name.endswith('.pyi'),
magic_trailing_comma=not configs["skip_magic_trailing_comma"],
preview=not configs["preview"],
**black_kwargs,
)
quiet = configs["quiet"]
Expand Down
3 changes: 3 additions & 0 deletions plugin/black.vim
Expand Up @@ -63,6 +63,9 @@ endif
if !exists("g:black_target_version")
let g:black_target_version = ""
endif
if !exists("g:black_preview")
let g:black_preview = 0
endif

function BlackComplete(ArgLead, CmdLine, CursorPos)
return [
Expand Down

0 comments on commit 4f134f3

Please sign in to comment.