X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2116eca51f1108ebc924185c87bc363d8e0329b3..6d0bdc2f38d57ddf07e7d127215d51f8553997f9:/src/black/__init__.py?ds=sidebyside diff --git a/src/black/__init__.py b/src/black/__init__.py index 2bb42a4..3671647 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2709,6 +2709,13 @@ def make_comment(content: str) -> str: if content[0] == "#": content = content[1:] + NON_BREAKING_SPACE = " " + if ( + content + and content[0] == NON_BREAKING_SPACE + and not content.lstrip().startswith("type:") + ): + content = " " + content[1:] # Replace NBSP by a simple space if content and content[0] not in " !:#'%": content = " " + content return "#" + content