[TxMt] Javascript indentation

Nate Cavanaugh nate at shift22.com
Wed Apr 30 15:38:13 UTC 2008


Hi all, I've tried searching for this, and my google-fu is weak.

Does anyone know how I would be able to change the indentation behavior for
just parenthesis in Javascript?

Basically, our code convention is so that when you have multiple arguments
on new lines (for instance, passing an anonymous function as a closure), the
closing parenthesis aligns to whatever the current tabbing level is.
Currently, the curly brackets do this now, and would like to mimic the
behavior, but can't make heads or tails of doing it with the current
indentation patterns.

Here's what I would like:
var xyz = (
\t
)

Here's how it actually currently is:

var xyz = (
\t)

Here are my current indenation rules, could anyone help me get what I'm
looking for, or have I been looking in the wrong place?

{	decreaseIndentPattern =
'^(.*\*/)?\s*(\}|\))([^{]*\{)?([;,]?\s*|\.[^{]*|\s*\)[;\s]*)$';
	increaseIndentPattern = '^.*(\{[^}"'']*|\([^)"'']*)$';
}

Thanks in advance all!
-- 
View this message in context: http://www.nabble.com/Javascript-indentation-tp16985640p16985640.html
Sent from the textmate users mailing list archive at Nabble.com.




More information about the textmate mailing list