[TxMt] Extending comment definition?

William Uther willu.mailingLists at cse.unsw.edu.au
Tue May 26 01:47:33 UTC 2009

Hi all,

   I'm looking to extend the definition of a comment in the textmate  
syntax highlighting, but I'm not quite sure how to achieve the effect  
I'm after.

   I frequently comment out snippets of code by sticking `if (false)  
{ ... }` around the code.  The other variation I use is to convert an  
existing condition into a comment: `if (false && previous condition)  
{ ... }`.  You don't want to over-use this idiom, but it is useful in  
its place.

   At the moment TextMate treats this just like normal code (which is  
exactly what you'd expect).  I was wondering if there was a way to  
make TextMate see these patterns as comments.  It isn't easy as you  
really want to pick the right brace to close the comment.  There could  
be further blocks of code nested inside the 'comment block'.

   This isn't a huge priority for me, but I thought I'd raise it and  
see if anyone had any obvious solutions.

Be well,

Will        :-}

More information about the textmate mailing list