[fpc-devel]Fold functionality in dos Ide

Sting stingray at swi.hu
Sat Oct 28 21:54:17 CEST 2000


>I've just seen the new functions in dos Ide for folding lines.
>
>As it is in earlier development stage, I think this is the best moment
>to express my opinions. By me, I would prefer a more automated way to
>fold lines, ie. move the cursor at the beginning of a line, and press a
>key to fold the following lines until a match condition is encountered.
>If the first line contains a Procedure or Function keyword, then a
>matching END is searched for. If the line contains a comment char, like
>(*, then fold until the closing one. The same, may be, could be
>applicable to other pascal blocks (records and objects).
Actually, we're planning to (optionally) generate the folds structure
directly from the parser tree. However, this requires major modifications in
the compiler. These modifications are currently in progress, but will take
some until the IDE can make use of them.

>Moreover, it would be very interesting to SAVE the file mantaining the
>current folds. May be using a special sequence in comments, for example
>(*$FOLD*)...(*$FOLDEND*). This way, it could possible to include a lot
>of comments in a source, without having to scroll them out when editing.
>In case we had the possibility to save, an easier way to select the
>lines to fold becomes less important - for every file the work would be
>done just once.
I don't think that storing fold information in the source code itself would
be a good idea. Storing fold information is obviously a trivial improvement,
but I think we should store it either in a separate file (for ex. in
test.fld for test.pas) or in a "common storage area" (like the desktop
file).

>Another nice thing would be nested folds. [...]
Nested folds can be created already.

>Another last thing (honest): how about let the user define keystrokes? I
>mean, I hate to type Ctrl-Q-F to search for text (I prefer Ctrl-F). This
>is not difficult to do like the points before.
This is a good idea, but isn't as easy to solve as you may think. I've put
it on my to-do list.

Gabor





More information about the fpc-devel mailing list