File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -198,11 +198,15 @@ def main():
198
198
new_sb_lines .append (line1 )
199
199
new_sb_lines .append (line2 )
200
200
continue
201
- if line .count ("(" ) == 1 and line .count (")" ) == 1 :
201
+ if (
202
+ line .count ("(" ) >= 1
203
+ and line .count ("(" ) == line .count (")" )
204
+ ):
202
205
whitespace = line_length2 - len (line .lstrip ())
203
206
new_ws = line [0 :whitespace ] + " "
204
- line1 = line .split ("(" )[0 ] + "("
205
- line2 = new_ws + line .split ("(" )[1 ]
207
+ first_paren = line .find ("(" )
208
+ line1 = line [:first_paren + 1 ]
209
+ line2 = new_ws + line [first_paren + 1 :]
206
210
if not ("):" ) in line2 :
207
211
new_sb_lines .append (line1 )
208
212
if get_width (line2 ) + w > console_width :
@@ -302,9 +306,7 @@ def main():
302
306
continue
303
307
elif line2 .count (", " ) == 1 :
304
308
line2a = line2 .split (", " )[0 ] + ","
305
- line2b = new_ws + (
306
- line2 .split (", " )[1 ]
307
- )
309
+ line2b = new_ws + line2 .split (", " )[1 ]
308
310
new_sb_lines .append (line2a )
309
311
new_sb_lines .append (line2b )
310
312
continue
Original file line number Diff line number Diff line change @@ -620,11 +620,15 @@ def main():
620
620
new_sb_lines .append (line1 )
621
621
new_sb_lines .append (line2 )
622
622
continue
623
- if line .count ("(" ) == 1 and line .count (")" ) == 1 :
623
+ if (
624
+ line .count ("(" ) >= 1
625
+ and line .count ("(" ) == line .count (")" )
626
+ ):
624
627
whitespace = line_length2 - len (line .lstrip ())
625
628
new_ws = line [0 :whitespace ] + " "
626
- line1 = line .split ("(" )[0 ] + "("
627
- line2 = new_ws + line .split ("(" )[1 ]
629
+ first_paren = line .find ("(" )
630
+ line1 = line [:first_paren + 1 ]
631
+ line2 = new_ws + line [first_paren + 1 :]
628
632
if not ("):" ) in line2 :
629
633
new_sb_lines .append (line1 )
630
634
if get_width (line2 ) + w > console_width :
@@ -722,9 +726,7 @@ def main():
722
726
continue
723
727
elif line2 .count (", " ) == 1 :
724
728
line2a = line2 .split (", " )[0 ] + ","
725
- line2b = new_ws + (
726
- line2 .split (", " )[1 ]
727
- )
729
+ line2b = new_ws + line2 .split (", " )[1 ]
728
730
new_sb_lines .append (line2a )
729
731
new_sb_lines .append (line2b )
730
732
continue
You can’t perform that action at this time.
0 commit comments