<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div>Hello,</div><div><br></div><div>thanks, this works ok but now every time I have any {comment}, TM shows a down fold arrow only (since there is no {/comment} obviously.</div><div><br></div><div>Is there a way to have the {block}...code...{/block} folding system differentiate from regular {comments}</div><div><br></div><div>It could be something like:</div><div><br></div><div>{<block>}</div><div>{comment on code}</div><div>code</div><div>{comment on loop}</div><div>{<loop>}</div><div>loop</div><div>code</div><div>end </div><div>{</loop}</div><div>more code</div><div>{</block>}</div><div><br></div><div>Only the {<...>} ...... {</...>} would have folding markers and not the regular {comment}.</div><div><br></div><div>Secondly regarding the language,
 there is no standard folding set but it would be nice to set up keywords that would start and end folds in user defined paired words like</div><div>function.... end function, if...end if, on init...end on, etc... Is that possible?</div><div><br></div><div>Thanks in advance.</div><div><br></div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family:arial, helvetica, sans-serif;font-size:13px">------------------------------<br><br>Message: 4<br>Date: Tue, 12 Jul 2011 13:01:25 -0700<br>From: Dru Kepple <<a ymailto="mailto:dru@summitprojects.com" href="mailto:dru@summitprojects.com">dru@summitprojects.com</a>><br>To: TextMate users <<a ymailto="mailto:textmate@lists.macromates.com" href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a>><br>Subject: [TxMt] Re: Custom Folding<br>Message-ID: <<a ymailto="mailto:882B4362-5E89-413C-AA0A-BA1FD64670DB@summitprojects.com"
 href="mailto:882B4362-5E89-413C-AA0A-BA1FD64670DB@summitprojects.com">882B4362-5E89-413C-AA0A-BA1FD64670DB@summitprojects.com</a>><br>Content-Type: text/plain; charset="us-ascii"<br><br>A basic folding pattern could be set up like this:<br><br>foldingStartMarker = '\{([^\/]+)\}';<br>foldingStopMarker = '\{\/.+\}';<br><br>This won't be smart enough to match the text in between the curly braces, but as long as you use the slash to mark an end comment, it should be pretty workable.  TextMate will handle nesting as you'd probably expect it to, so this:<br><br>{block}<br>code<br>{loop}<br>loop<br>code<br>end<br>{/loop}<br>more code<br>{/block}<br><br>Should fold as you'd want it to.<br><br>Do you have standard folding set up for the language?  I don't know what language you're using, but folding is usually set up for things like functions and loops, so that's helpful, too.  But I mention it because if you have to add the above markers into
 an existing language grammar that already has markers set up, you'll need to do them like this:<br><br>foldingStartMarker = 'otherMarker|\{([^\/]+)\}';<br><br>Note the vertical pipe in between the new addition and the existing marker; that's the regex "or".<br><br>Also, worth noting that TextMate only matches folds if the start and stop markers are at the same indent level, not merely if the marker is matched.  You might get some interesting folding results with the additions combined with goofy indentation.<br><br>+dru<br><br><br>On Jul 12, 2011, at 11:12 AM, John Relosa wrote:<br><br>Hello,<br><br>Excuse my newbie question but I am trying to do custom folding in the language that I am working on and can't figure out how.<br>Comments in this language start and end with { comment..... } Anything else is compilable.<br><br>Is there a way to specify something like<br><br>{Start of code block}<br><br>code<br>.<br>.<br>.<br>.<br>{/End of code
 block}<br><br>Thanks<br>John<br><br>_______________________________________________<br>textmate mailing list<br><a ymailto="mailto:textmate@lists.macromates.com" href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><mailto:<a ymailto="mailto:textmate@lists.macromates.com" href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a>><br><span><a target="_blank" href="http://lists.macromates.com/listinfo/textmate">http://lists.macromates.com/listinfo/textmate</a></span><br><br><br><br>-<br></div></div><div style="position:fixed"></div>


</div></body></html>