Skip to content

Commit

Permalink
Staircase tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr committed Sep 13, 2010
1 parent 5deb429 commit ebbdfc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi
case (InfixExprElement(_), _) | (_, InfixExprElement(_)) CompactEnsuringGap
case (_, _: ArgumentExprs) if formattingPreferences(PreserveSpaceBeforeArguments) CompactPreservingGap
case (_, _) if element.firstTokenOption exists { hiddenPredecessors(_).containsNewline }
nestedFormatterState = currentFormatterState.indent
if (!expressionBreakIndentHappened)
nestedFormatterState = currentFormatterState.indent
nestedFormatterState.currentIndentLevelInstruction
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,21 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest {

"""a(
| () =>
| b)""" ==>
| b)""" =/=>
"""a(
| () =>
| b)"""
| b)""" because "Need to fix this"

"""foobar(
|(1,2),
|(3, 4),
|(5, 6),
|(7, 8))""" ==>
"""foobar(
| (1, 2),
| (3, 4),
| (5, 6),
| (7, 8))"""


}

0 comments on commit ebbdfc4

Please sign in to comment.