X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c1c2418368cfcaa4f49edd7ec599fa45cce2d47d..40fae18134916b8499bd992d8bef4ae23bcd2986:/src/black/comments.py diff --git a/src/black/comments.py b/src/black/comments.py index 415e391..c7513c2 100644 --- a/src/black/comments.py +++ b/src/black/comments.py @@ -159,7 +159,10 @@ def convert_one_fmt_off_pair(node: Node) -> bool: first = ignored_nodes[0] # Can be a container node with the `leaf`. parent = first.parent prefix = first.prefix - first.prefix = prefix[comment.consumed :] + if comment.value in FMT_OFF: + first.prefix = prefix[comment.consumed :] + if comment.value in FMT_SKIP: + first.prefix = "" hidden_value = "".join(str(n) for n in ignored_nodes) if comment.value in FMT_OFF: hidden_value = comment.value + "\n" + hidden_value