There currently is no way to define foldingstopmarkers for these things. Allan informed me that he is planning to rewrite the folding code so that it is possible to fold these things.
Jeroen.
PS. Please don't use reply on a message to start a new thread. It messes up the threading display in clients that support it.
On 19 Oct 2004, at 10:51, Jeroen wrote:
There currently is no way to define foldingstopmarkers for these things. Allan informed me that he is planning to rewrite the folding code so that it is possible to fold these things.
Bliss!!
PS. Please don't use reply on a message to start a new thread. It messes up the threading display in clients that support it.
- not to mention the HTML archive! Ouch. Sorry...
-- Andre
On Tue, 19 Oct 2004 11:51:38 +0200, Jeroen jeroen@je-ju.net wrote:
Allan informed me that he is planning to rewrite the folding code so that it is possible to fold these things.
Alright, I'm going to make one more suggestion about folding and then shut up about it until we see what Allan comes up with when he has time get to this (though I'd love to hear about the direction of this development). :)
I've noticed other editors have a folding mode based on indentation. Basically, all blocks of text with the same indentation become folds (with the start being the first line outdented from the block and the end being the last indented line).
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.
Just a thought. Thanks.
A little suggestion for folding:
When there is the elipsis with a bunch of code in it, don't make it so easy to erase this whole chunk of code, just by deleting that elipsis. Perhaps when deleting that elipsis, make it beep, flash, or perhaps actually go into the code backwards, deleting normally. If you want to delete the whole chunk, you should have to do something a little more than hit backspace, perhaps, alt+backspace or right select with mouse then delete. Or maybe just a preference "Don't allow the deletion of folds with backspace"
Follow me?
Just a suggestion.
-Noel
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
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@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate