[TxMt] folding patterns and comments

Jeroen van der Ham jeroen at je-ju.net
Tue Jan 10 12:00:59 UTC 2006


Christopher Creutzig wrote:
>  Thanks, I thought of these and dismissed them – I'd really prefer
> 
> print(Unquoted, "// ".if a < 0 then a
>                       else a^2
>                       end);
> 
> to work.  What's more,
> 
> /* This should be done if and only
>    if we have a solution.  But then ...
>  */
> 
> is a comment as well.  I think I should really use TM's wonderful scope
> selectors.  Just wanted to check what others are doing, since the
> problem is not restricted to MuPAD and I couldn't find a workaround or
> fix in the bundles I peeked into.

I'm not completely sure, but I don't think you can use scope selectors 
when defining folds.
But note that the if occuring in the comment might match the 
foldstartmarker, but there would have to be a matching foldstopmarker at 
the same indent level to make it a fold. So I don't think that it would 
show up as a fold.

I think that if you really want this to work properly, you'll have to 
expand the match more to not only match "if", but also the pattern after it.

Jeroen.



More information about the textmate mailing list