X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c7c8c4f5018844d69edbc961c922b29f0d6ceeaf..92b377556e24616d5980a9010cf558da7fa35d28:/black.py?ds=sidebyside diff --git a/black.py b/black.py index 1c07de7..0dd7630 100644 --- a/black.py +++ b/black.py @@ -340,6 +340,7 @@ MATH_OPERATORS = { token.AMPER, token.PERCENT, token.CIRCUMFLEX, + token.TILDE, token.LEFTSHIFT, token.RIGHTSHIFT, token.DOUBLESTAR, @@ -888,7 +889,11 @@ def whitespace(leaf: Leaf) -> str: # noqa C901 if prevp.parent and prevp.parent.type in {syms.subscript, syms.sliceop}: return NO - elif prevp.parent and prevp.parent.type in {syms.factor, syms.star_expr}: + elif ( + prevp.parent + and prevp.parent.type in {syms.factor, syms.star_expr} + and prevp.type in MATH_OPERATORS + ): return NO elif prev.type in OPENING_BRACKETS: