Skip to content

Commit

Permalink
Fix inline cond formatting (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahularya50 authored and kavigupta committed Nov 11, 2019
1 parent 78046ba commit f29194c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def format(expr: Formatted, remaining: int, max_pred_len: int = 0) -> FormatSeq:
if isinstance(expr, FormatComment):
return CommentFormatter.format(expr)
else:
out = Token(expr.open_paren)
out = Token(expr.prefix) + Token(expr.open_paren)
inlined_pred = InlineFormatter.format(expr.contents[0])
pred_len = inlined_pred.max_line_len
pred_len = len(expr.prefix) + inlined_pred.max_line_len
out += inlined_pred
out += Token(" " * (max_pred_len - pred_len)) + Space()
out += InlineFormatter.format(expr.contents[1])
Expand Down

0 comments on commit f29194c

Please sign in to comment.