[TxMt] folding patterns and comments

Christopher Creutzig christopher at creutzig.de
Mon Jan 9 09:06:21 UTC 2006


Salvete,

 in a new language definition (MuPAD), I have

	foldingStartMarker =
'\b(proc|domain|case|if|%if|for|while|repeat|axiom|category)\b';
	foldingStopMarker =
'\b(end|end_proc|end_domain|end_case|end_if|end_for|end_while|end_repeat|end_axiom|end_category)\b';

Now, this works as expected, but I get folding markers whenever I type
the word “for” in a comment.  Should I switch comment contents
explicitly to text scope or what is the recommended way of dealing with
keywords appearing in comments?


 As an aside, another question on folding: MuPAD allows code of the
following structure (and that is actually quite common):

 if foo then
   dosomething()
 elif bar then
   dosome();
   thingelse();
 else
   noidea();
 end;

 case x
 of 1 do
   ...;
   break;
 of 2 do
   ...;
   break;
 otherwise
   ...
 end;

What I would like to have is the ability to fold away the indented parts
above, i.e., everything fom an if or elif to the next elif, else, end,
or end_if, whatever comes first, from else to end/end_if, from an of
inside case to the next of, otherwisem end_case, or end and so on.  But
it seems I can't have begin and end of two folding regions on the same
line, or can I?


regards,
	Christopher



More information about the textmate mailing list