Hello: I created a language grammar for the GI CP-1610 Assembly Language and I'm having trouble with getting code folding to work properly. I searched this list's archives and could not find an appropriate answer. The closest topic was a question by Abhi L, on Nov. 2009 regarding the same issue, which went unanswered.
The typical block pattern in this language is as follows:
; Procedure LABEL PROC ; ; code ; ENDP
; Record LABEL STRUC ; ; constants ; ENDS
Apparently, TextMate's code folding only works when the end marker occurs at the same indentation level as the start marker. Or something like that. I've experimented with a stock-included bundle, the one for Perl, and noticed the same behaviour:
# This folds properly in all brackets sub foo { if (bar) { # code }
# This block only folds if the bracket below # is at the same indentation as its matching # sibling. }
# This does not fold sub foo { # code }
Is there a way around this? If so, how? Below are the regexps I use for my language grammar:
foldingStartMarker = '(\s+(PROC|STRUCT)\b.*$)|(^MACRO\s+)'; foldingStopMarker = '^\s*(ENDP|ENDS|ENDM)\b';
Thank you in advance, cheers! dZ.
Michael Sheets wrote:
On Jun 13, 2010, at 7:12 AM, DZ-Jay wrote:
Is there a way around this? If so, how? Below are the regexps I use for my language grammar:
No, the regex isn't even considered if the indention level isn't the same.
Bummer.
The old messages I found in the archive related to this topic mentioned that the developers were working on a new folding engine. I was all excited until I noticed that the messages dated back to 2004 or whereabouts. I'm guessing this didn't happen.
Any chance of this being addressed in a future version?
dZ.
On 14 Jun 2010, at 20:31, DZ-Jay wrote:
Bummer.
The old messages I found in the archive related to this topic mentioned that the developers were working on a new folding engine. I was all excited until I noticed that the messages dated back to 2004 or whereabouts. I'm guessing this didn't happen.
Any chance of this being addressed in a future version?
dZ.
Yes. In Textmate 2.0.
Daniel
Daniel Stegmueller wrote:
On 14 Jun 2010, at 20:31, DZ-Jay wrote:
Bummer.
The old messages I found in the archive related to this topic mentioned that the developers were working on a new folding engine. I was all excited until I noticed that the messages dated back to 2004 or whereabouts. I'm guessing this didn't happen.
Any chance of this being addressed in a future version?
dZ.
Yes. In Textmate 2.0.
Hum. Is there an ETA, or were you just begin facetious?
dZ.
On 14-06-2010, at 21:31, DZ-Jay wrote:
Daniel Stegmueller wrote:
On 14 Jun 2010, at 20:31, DZ-Jay wrote:
Bummer. The old messages I found in the archive related to this topic mentioned that the developers were working on a new folding engine. I was all excited until I noticed that the messages dated back to 2004 or whereabouts. I'm guessing this didn't happen. Any chance of this being addressed in a future version? dZ.
Yes. In Textmate 2.0.
Hum. Is there an ETA, or were you just begin facetious?
There is no ETA.
Berend
On 14 Jun 2010, at 20:31, DZ-Jay wrote:
The old messages I found in the archive related to this topic mentioned that the developers were working on a new folding engine. I was all excited until I noticed that the messages dated back to 2004 or whereabouts. I'm guessing this didn't happen.
TM was first released in October 2004, I don’t think I was planning to rewrite the folding engine as the first thing back then — I have often been positive about improving the folding system, but the suggestions I have received tend to make things ten times as complex but only give very few advantages over the current scheme.
On Jun 14, 2010, at 16:38, Allan Odgaard wrote:
TM was first released in October 2004, I don’t think I was planning to rewrite the folding engine as the first thing back then — I have often been positive about improving the folding system, but the suggestions I have received tend to make things ten times as complex but only give very few advantages over the current scheme.
Sorry, I didn't mean 2004, more like 2007 and 2008.
I understand how it is, and I truly appreciate your efforts; TextMate is a great editor, with or without code-folding--which, by the way, I find reasonable for most cases.
dZ.