Using the Scala mode:
val x = if (foo)
42
else
24
If I wrap the if
expression in its entirety in parentheses by selecting the block and pressing (, Sublime forces the result to be the following:
val x = (if (foo)
42
else
24)
Note that this does not happen if the base indentation is 0:
val x = if (foo)
42
else
24
// wraps to
val x = (if (foo)
42
else
24)
And similarly, if I increase the indentation level, the effect is magnified:
val x = if (foo)
42
else
24
// wraps to
val x = (if (foo)
42
else
24)
There is nothing in the Scala mode which is generating these semantics. I know because I rewrote all of the Scala indentation rules a few months ago, specifically intending to fix this issue. I couldn’t.
The semantic appears to be something in Sublime itself. Is this a bug? If not, is it configurable?