Closed hvesalai closed 7 years ago
with scala-indent:align-format
t
val y = if (x)
foo
else
bar
and else
val y = if (x)
foo
else
bar
I like that example. I tend to use scalariform (or scalafmt) as part of my build so unfortunately even if this is prettier than scalariform it won't impact my checked in code... @olafurpg do you have any cool features for this kind of alignment?
scalafmt would reformat that as
val y =
if (x)
foo
else
bar
Scalafmt has lots of alignment goodies but not for if
/else
.
scala-mode doesn't format the code other than indent it. So with the newline between =
and if
it would do the same as your formatter.
cool, it's good to catch the discrepencies. Once I get used to the auto formatter, I tend to write code that doesn't need to be auto formatted (much)
@nloyola heads up, please give this a spin!
Thanks @hvesalai! It works for me.
This needs some testing. It's a clear bug fix but still changes the handling of many things