[TxMt] foldingStopMarker with leading whitespace

DZ-Jay dz at caribe.net
Sun Jun 13 12:12:47 UTC 2010


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.




More information about the textmate mailing list