Skip to content

Commit 8507953

Browse files
committed
Remove only whitespaces for comment indentation
1 parent 80224b2 commit 8507953

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pycco/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ def save(docs, code):
116116

117117
elif multi_line:
118118
# Remove leading spaces
119-
docs_text += line[len(indent_level):] + '\n'
119+
if re.match(r' {%d}' % len(indent_level), line):
120+
docs_text += line[len(indent_level):] + '\n'
121+
else:
122+
docs_text += line + '\n'
120123

121124
elif re.match(language["comment_matcher"], line):
122125
if has_code:

0 commit comments

Comments
 (0)