File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def _tokenize(f):
149
149
space = ""
150
150
if tok .start > last_end :
151
151
assert tok .start [0 ] == last_end [0 ]
152
- space = " " * ( tok .start [ 1 ] - last_end [1 ])
152
+ space = tok .line [ last_end [ 1 ] : tok . start [1 ]]
153
153
yield (space , tok .type , tok .string )
154
154
155
155
last_end = tok .end
Original file line number Diff line number Diff line change
1
+ # fmt: off
2
+ async def dummy ():
3
+ await dummy2 () # This line is indented with a tab that should be preserved
4
+ # fmt: on
5
+
6
+
7
+ async def dummy2 ():
8
+ await dummy () # This one uses 4 spaces and these should also be preserved
Original file line number Diff line number Diff line change
1
+ # fmt: off
2
+ def dummy ():
3
+ dummy2 () # This line is indented with a tab that should be preserved
4
+ # fmt: on
5
+
6
+
7
+ def dummy2 ():
8
+ dummy () # This one uses 4 spaces and these should also be preserved
You can’t perform that action at this time.
0 commit comments