X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/3fca540d05a0f0b4480cfcce84d7e0392270b841..3a309a36fcfc30a96a7fdd68b6b2c3aa2aa5341c:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index 7c1a013..6dbb765 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2635,7 +2635,7 @@ def list_comments(prefix: str, *, is_endmarker: bool) -> List[ProtoComment]: consumed = 0 nlines = 0 ignored_lines = 0 - for index, line in enumerate(prefix.split("\n")): + for index, line in enumerate(re.split("\r?\n", prefix)): consumed += len(line) + 1 # adding the length of the split '\n' line = line.lstrip() if not line: