X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ffaaf4838228c922b586a87f717ed402031fcc0a..8091b2503d12dd0110e0f1a9ed1e6b830aa668ed:/src/black/lines.py diff --git a/src/black/lines.py b/src/black/lines.py index 0d07453..08281bc 100644 --- a/src/black/lines.py +++ b/src/black/lines.py @@ -53,7 +53,9 @@ class Line: should_split_rhs: bool = False magic_trailing_comma: Optional[Leaf] = None - def append(self, leaf: Leaf, preformatted: bool = False) -> None: + def append( + self, leaf: Leaf, preformatted: bool = False, track_bracket: bool = False + ) -> None: """Add a new `leaf` to the end of the line. Unless `preformatted` is True, the `leaf` will receive a new consistent @@ -75,7 +77,7 @@ class Line: leaf.prefix += whitespace( leaf, complex_subscript=self.is_complex_subscript(leaf) ) - if self.inside_brackets or not preformatted: + if self.inside_brackets or not preformatted or track_bracket: self.bracket_tracker.mark(leaf) if self.mode.magic_trailing_comma: if self.has_magic_trailing_comma(leaf):