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