X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/f99fad1b78a773f2a712b9ce21496e80cce6cf4f..23fec8b0f73a142d1796c8ca958230ad52d83c24:/black.py diff --git a/black.py b/black.py index 3231503..a48f647 100644 --- a/black.py +++ b/black.py @@ -3056,9 +3056,14 @@ def generate_ignored_nodes(leaf: Leaf) -> Iterator[LN]: """ container: Optional[LN] = container_of(leaf) while container is not None and container.type != token.ENDMARKER: + is_fmt_on = False for comment in list_comments(container.prefix, is_endmarker=False): if comment.value in FMT_ON: - return + is_fmt_on = True + elif comment.value in FMT_OFF: + is_fmt_on = False + if is_fmt_on: + return yield container