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.
ruby-indent-case-whenandruby-deep-indent-block-assignmentor something. Maybe. Currently I just subconsciously know to useC-q C-jto create newlines in places where my indentation would be changed. - d11wtq