[TextMate] Re: Folding in text with no stop marker

Phil Aaronson phil at hinkty.com
Tue Oct 19 23:18:29 UTC 2004


Hi All,

I might as well toss out another wrinkle in the fold behavior (yeah 
yeah bad pun). My ideal fold would include both code block and the 
comments that precede it. Not sure if begin/end or indent can do that. 
I tried playing around with the begin/end tags and didn't get anywhere. 
But if we could, somehow, along with THAT, It would be sweet to be able 
to specify comment directives that remain outside the fold.

So if I had:

/**
* this is long winded comments.
* @fold the good stuff
* more long winded comments.
* @fold more good stuff
* @param $gaa lalala
*/
function goo($gaa = "lalala") {
	blah;
	blah;
	blah;
}

and if I specified @fold directives as "special", then that would get 
folded into one fold "block"/logical unit/thing as:

* the good stuff
* more good stuff
function goo($gaa = "lalala") ...

Thought I'd just toss that out there. And if my last suggestion that we 
should include fold commands in the undo stack is any indication ... 
I'll duck now :)

Phil

On Oct 19, 2004, at 3:12 PM, Andre Posumentov wrote:

> On 19 Oct 2004, at 21:39, Chris Brierley wrote:
>
>> It seems to me this would work perfectly for Python and the other
>> cases that Andre mentioned.  I also think it would work for most cases
>> of "sanely" written code, without having to specify start and stop
>> markers in the bundles.
>
> Agree, but I think you need both...
>
> Certainly, if TM is to support folding for Python, then a mode that 
> works on purely on indentation is essential.  (For those not familiar 
> with it, indentation _is_ the block structure in Python code).
>
> But for languages that do define block start and end 'markers', I'm 
> sure people want the flexibility to be able to put those markers where 
> they see fit - and not be restricted to a particular style of 
> indentation.  C is a good example of a language in which people become 
> attached (sometimes to the point of terminal neurosis ;), to a 
> particular block style - and not always one that strictly follows the 
> rules of indentation.
>
> I think my favourite solution would be to have 'indentation-based' 
> folding as a default, which could then be overridden by the definition 
> of start / stop markers. (Either or both).
>
> I'll shut up now too ..
>
> Cheers,
> -- Andre
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate
>




More information about the textmate mailing list