Skip to content

Instantly share code, notes, and snippets.

@non
Created November 8, 2012 18:25
Show Gist options
  • Select an option

  • Save non/4040577 to your computer and use it in GitHub Desktop.

Select an option

Save non/4040577 to your computer and use it in GitHub Desktop.
scala-mode2 indenting status
// ok
def foo0(x: Int) =
x match {
case 99 => 123
case _ => 999
}
// not great, prefer 1-dedent for last 3 lines
def foo1(x: Int) = x match {
case 99 => 123
case _ => 999
}
// ok
def foo2(x: Int) = x + 9
// ok
def foo3(x: Int) =
x + 9
// ok
def foo4(x: Int) =
x match {
case 99 => 123
case _ => 999
}
// not great, prefer dedent for last 4 lines
def foo5(x: Int) = if (x > 10) {
123
} else {
999
}
// ok
def foo6(x: Int) =
if (x > 10) {
123
} else {
999
}
// failed, should resemble 8 but dedent last 4
def foo7(x: Int) = if (x > 10)
123
else
999
// ok
def foo8(x: Int) =
if (x > 10)
123
else
999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment