Closed mbriggs closed 12 years ago
You might get the behavior you want from setting js3-consistent-level-indent-inner-bracket t
. You can do this with M-x customize-group RET js3-mode RET
. This forces function bodies to always just be indented once.
I've been thinking about implementing a special case for just certain function
idioms. Let me know whether js3-consistent-level-indent-inner-bracket
does what you want.
So far I've been erring on the side of consistency. I try to always indent from the start of whatever expression is being continued, except for obvious special cases. Currently there are some terrible compromises where it's not clear what's best, like function expressions in var
statements. I can indent from the start of the variable assignment sub-expression or just one indent, and both options look weird in some special cases. I'm hoping the js3-consistent-level-indent-inner-bracket
solves most people's problems, but I should probably document it somewhere.
js3-consistent-level-indent-inner-bracket worked for the cases above, and also for function declarations in multi expression vars, which makes me really happy :) huge fan of js3, keep up the good work
Probably my only complaint with js3 indentation is this style of function (using 2 spaces for indentation)
where it adds an extra space to align code against the f in function, and the closing }. it is more noticeable if you are one of the "no semicolons except on lines starting with (" hippy like me :)
I think ideally, it would look like this
probably one of those things that is mind rendingly hard to implement, but I figured I would ask in the off chance that its easy :)