X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/1b696555e18afdfee3ca45526370de1af2cd961d..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: