[TxMt] Re: Extending comment definition?

Oliver Taylor olivertaylor at me.com
Sat May 30 03:10:34 UTC 2009


On Mon, May 25, 2009 at 6:47 PM, William Uther
<willu.mailingLists at cse.unsw.edu.au> wrote:
> I was wondering if there was a way to make TextMate see these patterns as
> comments.

Comments are defined per-language, so you'd have to edit the language
grammar of whatever code you're writing in. Edit either the language
itself or, if the bundle has it, the comment preference item. It would
look something like this:

{name = 'comment';
begin = '\bif \(flase\) \{';
end = '\}';
},

> It isn't easy as you really want to pick the right brace to close the
> comment.

That would be up to the regex you define.

> There could be further blocks of code nested inside the 'comment block'.

In theory it would work. Search for "code repositories" for more info.



More information about the textmate mailing list