Expand/Collapse blocks of text

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

How important is this feature for future versions of TextPad?

Important, even if the size/efficiency of TextPad increases/degrades
131
51%
Somewhat important
80
31%
I'm okay either way
24
9%
Somewhat unimportant
13
5%
Unimportant, even if the size/efficiency of TextPad remains unaffected
10
4%
 
Total votes: 258

MiddleOfNowhere
Posts: 5
Joined: Wed Jul 23, 2003 10:07 am

Post by MiddleOfNowhere »

Apart from the technical details of how to store folding status - which are undoubtedly exciting ... -, what do people think which "extras" this feature should have?

E.g. in jEdit, folding a section will tell you how many lines the folded section has - a nice detail that probably could be expanded. So a folded section might be shown with the number of characters, lines and maybe sub-structures.

Also, there should be keyboard commands for things like Expand/Collapse All/Selected Node(s).

And syntax highlighting for folded sections would be nice ...

What else?
richardtallent
Posts: 5
Joined: Wed Aug 06, 2003 9:19 pm
Location: Beaumont, TX
Contact:

Post by richardtallent »

Suggestion for implementation:

- The ability to fold based solely on tab indentation level, making the feature useful for almost any language OOTB. This should allow switching between the two common indentation styles:

Style 1:
Starting Keywords
Inner Line(s)
Ending Keywords / Brace

Style 2:
Starting Keywords
Inner Line(s)
Ending Keywords / Brace

- Shade the selection that will be folded when mouse is over the fold icon ("[-]") in the margin.

- Ability to set certain document classes to load folded.

- EASY keyboard mappings to fold/unfold while navigating. Potentially Alt-Left and Alt-Right? (Can't remember if they are used for anything by default).

- Microsoft.NET's C# has a peculiar commenting syntax: you place the documentation for a function in comments *before* the function implementation. I suppose this can be handled by a decent regular expression that searches for the formatted comment rather than the function specification itself as the "start line", but it's worthy of mentioning.
jdonnici
Posts: 4
Joined: Mon Aug 11, 2003 4:39 pm

Re: Nah...

Post by jdonnici »

Just another (late) vote for this feature. Microsoft's VS.NET has it, including the ability to name/define your own "foldable" regions, and it's a great addition. Being able to map shortcut keys to the expanding/collapsing of regions would also be key, I think.
JonK wrote:Making folding require NTFS is like making transparent dialogs require W2K or better.
Wrong. Transparent dialogs are nice, but not having them doesn't limit the functionality for those not running W2K or newer. It just means that you may have to move the dialog to see what's behind it.

Making the ability to expand/collapse regions within a file dependent on NTFS would be a horrible choice on the part of Helios. While I am running WinXP Pro on NTFS, there are lots of people out there still running on earlier versions of Windows or who, for other reasons, aren't able to run NTFS.
s05ullivan
Posts: 1
Joined: Sat Aug 30, 2003 7:40 pm

Outline mode

Post by s05ullivan »

Most of the messages with respect to an expand/collapse feature have been oriented toward Code/Tag based files. I'm interested in a general outlining feature akin to what's possible in M$ Word and PowerPoint, but without the dorked up font changes. In this *.TXT editing mode/class, the text indentation would indicate outlineline level. This would naturally lead to a new outline toolbar with +, ++, -, 1, 2, 3, etc. buttons for expand, expand all, collapse, show outline at level 1 or 2 or ...

-- Sean

License code: ZEA2-RAEU-R5KT-5QST
Jason Shallcross
Posts: 13
Joined: Tue Sep 02, 2003 2:43 pm
Location: Brighton, East Sussex
Contact:

Folding Blocks

Post by Jason Shallcross »

I don't really have much to say that hasn't already been said, I just want to give the feature my thumbs up. It would be really nice to be able collapse sections of code and to be able to see where a block really starts and finishes, not just where you think it does!
User avatar
maniac
Posts: 33
Joined: Thu Sep 25, 2003 4:16 am
Contact:

Re: Nah...

Post by maniac »

Instead of quoting everything about the NTFS stuff - keep this in mind. Whether anyone likes it or not, TextPad is, for the most part, a source code editor. The second you introduce hidden streams and stuff into the source files, you kill the program completely. As for keeping them in a workspace being a problem, the workspaces are relative - if you can't keep all your files together under one folder, that's you're problem ;)

btw, I love this idea - but, what about making them not only shrink brackets and html tags, but also, maybe some kind of new bookmark, that has a begining AND an end, that way it stays in the workspace, but allows you to set a custom region that can be collapsed
Stack
Posts: 3
Joined: Fri Dec 12, 2003 2:33 am

Fold it!

Post by Stack »

I would very much appreciate code folding. For usefulness I would agree that arbitray regions would be useful. Ideally I would like to be able to use something like MS's #region as text within the file - I tend to be writing quite a bit of c# these days.

It would be handy to be able to define folding regions within a syntax file too - but even if it was only available from a built-in TextPad command it would still make a huge difference.

Personally I don't care if it was stored in the file as a tagged field, whethre it used something like the #region mechanism or was stored in the workspace - a choice of all three would be particularly good.

In my view it is the only thing missing from TextPad, although I occasionally think it would be nice to be able to use it as a command line editor like sed
User avatar
ramonsky
Posts: 88
Joined: Fri Nov 14, 2003 10:54 am

Post by ramonsky »

Well, I'm voting for folding, but NOT for remembering the state.

(Actually, I think the whole concept of meta-information about a text file is best left to another thread. Okay, I'll start one. Okay, done - it's here).

For what it's worth, MS Visual Studio .NET 2003 does exactly this (folding - but not remembering the state). I confess it's a feature I don't use much. Maybe I just haven't got the hang of it yet.

Jill
Jesus_H_Christ
Posts: 3
Joined: Tue Jan 20, 2004 5:50 pm
Location: Stratford, CT
Contact:

Post by Jesus_H_Christ »

i would enjoy this feature very much HOWEVER one of the things I enjoy the most about textpad is it's good, simple tab support. please don't make this feature molest the way i use tabs in any way shape or form.
Justin R. Tunney
lichudang
Posts: 5
Joined: Tue Jan 27, 2004 8:36 pm

Post by lichudang »

One thing I like about TextPad is its simple look and feel, great usabilty. If this text folding feature get into the way of this TextPad beauty, I would not recommended. All those Macromedia, Homesite editors are clunky in ways. That is why I never stick to any of those but TextPad. Just my thought.
zbert
Posts: 3
Joined: Fri Feb 13, 2004 12:05 am
Location: New York

Post by zbert »

Oh please put this feature into the next version of TextPad. It's hard to believe that TextPad could be any better but this would make it so.

--zbert
User avatar
gracefool
Posts: 76
Joined: Thu Jan 29, 2004 7:21 am
Location: Wellington, New Zealand
Contact:

Post by gracefool »

YES, YES, YES!

This would be very helpful when dealing with large documents.

Just get a basic version working, I don't care so much about fancy options etc.

And, of course, folding status should be stored in the workspace.
city
Posts: 2
Joined: Wed Apr 07, 2004 3:34 pm
Location: riesa, germany
Contact:

Absolutely a must!

Post by city »

The old GoldED for the Amiga had this feature in 1997 or earlier. I really loved it.

Codefolding is a feature that would be an immense benefit.

There should be keywords for the beginning and the end of a fold definable for each document-class.

The naming of the fold could be done by the text following the beginning-keyword.

pascal:
[...]
begin (* my fold here *)
writeln('bla');
end
[...]

could be folded to
[...]
> (* my fold here *)
[...]

what i want to say is, that folding by { and } pairs wouldn't be flexible enough. and of course Strings should not be parsed for folding keywords too.

Folds in folds would be very nice too.

As others said, folding and unfolding should be possible by keyboard.

In GoldED there was it also possible to fold and unfold the innermost fold relative to the mouse-pointer by shift-left-click (of course user defined).

a fold-line should be shown in a special color.

oh dear, i've been waiting for an editor-feature like this for years yet.
www.remoteschach.de - serverchess at its best
antx
Posts: 1
Joined: Wed Apr 07, 2004 3:30 pm

Post by antx »

I´m currently using jedit cos it has at least some code folding. I´m not quite content with it since it can only fold on bracket base but that's better than nothing.
Back in the old day's I was using Gold-ED on the Amiga. This editor had a very good folding solution. in the editor settings you could define strings that indicates a start and an end of a fold. That way you are free to place your folds where ever you want them. In my case it looked like that:

/*S*/ // Function Test() -- is doing this and that.
function test()
{
bliblobla;
}
/*E*/
----
/*S*/ was my fold start indicator and /*E*/ my fold end indicator.
Since they were comments, the compiler or what ever would not mind them.
----
folded it looked like that:

// Function Test() -- is doing this and that.
----
I wouldn´t mind if the number of folded lines where stated there as well (like jedit does it)
----
I personally don´t need the editor to remember the state of each fold. As long as I can specify in the settings that all folds should be either open or closed after loading, it´s fine for me.
But perhaps the editor could store those information in the fold line when ever it it saving the file, like:

/*S*/ /*closed*/ my fold
bliblobla
blabliblo
/*E*/
scott1
Posts: 7
Joined: Wed Apr 28, 2004 12:55 am
Location: Sydney, Australia

Post by scott1 »

Yes, I would use code folding a lot.

As a corollary to the code folding concept, I would like to be able to filter based on a string(s), then edit the remaining lines, then remove the filter.

So, if I have a 10,000 line file, I give the command "filter foo". I then edit the 10 lines containing "foo". Then "unfilter foo" (or "show all"), and the file reverts from its virtual view to the actual view.

This would be very useful for me.
Post Reply