[TxMt] help with setting up language

Dru Kepple dru.textmate at gmail.com
Fri Jun 16 17:14:50 UTC 2006


Hi, I was hoping someone could point out what I'm doing wrong.

I've customized my ActionScript lanugage definition to be "Javadoc aware."
I'm having trouble setting up the foldings regex (being an ActionScripter, I
don't regularly use regex, so maybe that's part of the problem.  Can't wait
for AS3, though...).

Here's what I have:

    foldingStartMarker = '(/\*|\{\s*$|\[\s*$|\(\s*$)';
    foldingStopMarker = '(\*/|^\s*\]|^\s*\}|^\s*\))';


// and later...
        {    name = 'comment.javadoc.actionscript';
            begin = '/\*\*';
            end = '\*/';
        },


And here's what happens.  I ype "/**".  At this point the language
definition knows that I'm in comment.javadoc.  I get a downward-pointing
arrow for the top of the code fold area.  I've also get snippets set up to
expand /** into

/**
 *
 */

and return the caret to the middle line.  There is a single space at the
front of the bottom two lines.  (I also have it set up to replace a return
press with a return and an asterisk, but that's beside the point)  Now, I
don't get the upward-pointing arrow for the bottom of the code fold area.  I
just discovered that the space seems to be throwing it off.  If I go back to
the closing of the javadoc comment, and remove that initial space, I get
code folding.

So I tried modifying the foldingStopMarker, but with no success.  Is there
an easy way to do this?  Am I being a moron and doing this completely the
wrong way?  I've tried a number of regex's:

foldingStopMarker = '(^\s*\*/|^\s*\]|^\s*\}|^\s*\))';
foldingStopMarker = '(\s*\*/|^\s*\]|^\s*\}|^\s*\))';
foldingStopMarker = '( \*/|^\s*\]|^\s*\}|^\s*\))';
foldingStopMarker = '(^[ \t]*\*/|^\s*\]|^\s*\}|^\s*\))';

And many variations thereof, but with no luck.  I may be just
misunderstanding how the foldingStopMarker works in the first place, but if
anyone can point me in the right direction I'd be very appreciative.  I like
my asterisk's to line up, and I like my code folding.

Thanks,
Dru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060616/ed6cc353/attachment.html>


More information about the textmate mailing list