Folding: Design Criteria, draft

Aaron Hsu arcfide at sacrideo.us
Wed Mar 5 23:24:38 CET 2008


Tony Balinski <ajbj at free.fr> writes:

> Quoting Aaron Hsu <arcfide at sacrideo.us>:
>
>> Also, once folded, BBEdit uses a simple "(...)" looking object to
>> denote the folded region, and I like that. There is another method,
>> like Emacs, where you can actually hide any selection of code, but I
>> don't think that's the way to do code folding in this case.
>
> Agreed. I would like to see the visual representation programmable too
> (by macro) so that it could contain commentary, but with a default
> (that cannot be zero-width). Visually, the marker must stand out
> always. Making appear as a shaded button (motif-like) would make it
> stand out from the simple text coloring we have just now. An indicator
> in the line-number or extra gutter would be nice too.

One comment I would make on that is to make sure that the button
configuration is at least configurabe, because I would Not want a 3-d
motif button in the middle of my test. A different colored square button
might be okay, but even then, we would need to ensure that the button
doesn't "feel" like a button, but feels more like a single block of text
that moves as a unit.

>> I also notice that you seem to think that folds on a per line basis
>> are more common? Well, most of my experience is with BBedit, and in
>> that, folds are between any two arbitrary points in the code, and it
>> should be possible to fold at any arbitrary selection, and have it
>> turn into a little (...) object or some such. :-)
>
> Agreed again. Arbitrary folding should be allowed. Folds should be
> able to contain other folds, but if a fold start position is inside
> another fold, the outer fold also contains its end position, ie no
> overlapping of extremities.

I also think this is the way is should go. Overlapping regions aren't
very nice imo. In fact, that's part of the niceties about code
folding. When writing code, if the code is not balanced into its proper
hierarchy, the proper end delimiting fold character in the gutter on the
left won't show up, just the start caret, and that shows you that you've
got a code error.

-- 
Aaron Hsu <arcfide at sacrideo.us> | Jabber: arcfide at jabber.org
``Government is the great fiction through which everybody endeavors to
live at the expense of everybody else.'' - Frederic Bastiat



More information about the Develop mailing list