Skip to content

Commit 69a2304

Browse files
committed
fix: fix tab-space mix with tab indenation and continuation_align_style=SPACE
1 parent 633744e commit 69a2304

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

yapf/yapflib/format_token.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def _TabbedContinuationAlignPadding(spaces, align_style, tab_width):
7777
if spaces > 0:
7878
return '\t' * int((spaces + tab_width - 1) / tab_width)
7979
return ''
80-
return ' ' * spaces
80+
if spaces % tab_width == 0:
81+
return '\t' * (spaces // tab_width)
82+
return ' ' * spaces # TODO: add a comment why we indent with spaces in a tab area?
8183

8284

8385
class FormatToken(object):

0 commit comments

Comments
 (0)