In Emacs, using ruby-mode, I can’t find a way to stop this happening:
foo = if something?
42
else
7
end
When our in-house conventions are:
foo = if something?
42
else
7
end
(Same goes for begin..end and case..when).
Also, while it’s less of a nuisance, our convention for case..when is to indent each when.
case whatever
when foo
"a"
when bar
"b"
else
"c"
end
I know people generally say you should align the when with the case, but it’s not the convention of our company, so does anybody know how to customize this too? I can find very little customization for ruby-mode. The only thing I’ve really been able to customize is the indentation inside parentheses.
There is no way to customize this. ruby-mode is pretty barebone as far as indentation customizations are concerned and Matz (its original author) is totally adamant in supporting the standard style for case indentation.