[TxMt] Javascript indentation

Nate Cavanaugh nate at shift22.com
Fri May 16 17:04:57 UTC 2008


Heya Daniel,
I apologize for the delay. This never made it to my email, but let me just
say that is EXACTLY what I was looking for :)
You have just saved me hours of time in typing to correct it.

You sir, are THE man! :)

Daniel Stockman wrote:
> 
>> Here's what I would like:
>> var xyz = (
>> \t
>> )
>>
>> [snip]
>>
>> 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?
> 
> What you're actually looking for is a snippet, not indentation regex.  
> I would also suggest using Thomas Aylott's refactored JavaScript  
> bundle, currently in the Review section of the repository. It adds  
> scopes for the various braces that makes this much simpler to  
> implement (among many other reasons for using it).
> 
> The basic pattern is the same as the snippet in the HTML bundle named  
> "Special: Return Inside Empty Open / Close Tags". It relies on the  
> meta.scope.between-tag-pair selector, which is defined in the language  
> grammar. The content of the snippet for JavaScript is exactly the  
> same, you'll just need to adjust the scope selector according to the  
> particular flavour of JavaScript.tmbundle you are using.
> 
> I've attached my own take on it, which also applies to array literals  
> ( [] ).
> 
> Hope this helps,
> Daniel
> 
> 
>  
> 
> 
> 
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
> 

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




More information about the textmate mailing list