Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-03

Commenting.

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Kjow

Hi all!

Everytime I need to comment a part of the code with (e.g. { ... } ) and I have some parts of code "minimized" with the "-"/"+" on the left of editor (Please excuse me, I don't know the technical term - e.g. http://3.bp.blogspot.com/_UuDt8fZYCTg/TDCZtgbGUqI/AAAAAAAAAQ8/HcoRx10cuE0/s1600/lazarus.png on the left of uses, TForm1, etc), just writing the first "{" every part after the "{" "minimized" will expand. This is a little bit annoying...

is it possible to mantain minimized codes also inside "comments"?

Thank you!
Kjow

Reply by email

Kjow
to Kjow

2011/3/15 Kjow :

Show quoted text 15 lines
Hi all! Everytime I need to comment a part of the code with (e.g. { ... } ) and I have some parts of code "minimized" with the "-"/"+" on the left of editor (Please excuse me, I don't know the technical term - e.g. http://3.bp.blogspot.com/_UuDt8fZYCTg/TDCZtgbGUqI/AAAAAAAAAQ8/HcoRx10cuE0/s1600/lazarus.png on the left of uses, TForm1, etc), just writing the first "{" every part after the "{" "minimized" will expand. This is a little bit annoying... is it possible to mantain minimized codes also inside "comments"? Thank you! Kjow

No possibilities?

Kjow

Reply by email

Martin
to Kjow
Kjow wrote 12 lines
2011/3/15 Kjow: > Hi all! > > Everytime I need to comment a part of the code with (e.g. { ... } ) > and I have some parts of code "minimized" with the "-"/"+" on the left > of editor (Please excuse me, I don't know the technical term - e.g. > http://3.bp.blogspot.com/_UuDt8fZYCTg/TDCZtgbGUqI/AAAAAAAAAQ8/HcoRx10cuE0/s1600/lazarus.png > on the left of uses, TForm1, etc), just writing the first "{" every > part after the "{" "minimized" will expand. This is a little bit > annoying... > > is it possible to mantain minimized codes also inside "comments"?

The term is "folding". and yes there is a problem with all folded blocks being unfolded, whenever you start a comment. Unfortunately this is not fixed yet.

However a few tricks that maybe can help.
Depending on OS, you may have to set the keyboard shortcuts in the options first)

shift-alt-1 => fold all nodes (pascal nodes, not IFDEF) shift-alt -2 => fold all level 2 nodes (nested nodes) ....
shift alt 0 => unfold all

also you can write the closing "}" first, but it is very easy to forget....

Martin

Reply by email

Hans-Peter Diettrich
to Kjow: 2011/3/15 Kjow : No possibilities? Kjow
Show quoted text 12 lines
2011/3/15 Kjow : > Hi all! > > Everytime I need to comment a part of the code with (e.g. { ... } ) > and I have some parts of code "minimized" with the "-"/"+" on the left > of editor (Please excuse me, I don't know the technical term - e.g. > http://3.bp.blogspot.com/_UuDt8fZYCTg/TDCZtgbGUqI/AAAAAAAAAQ8/HcoRx10cuE0/s1600/lazarus.png > on the left of uses, TForm1, etc), just writing the first "{" every > part after the "{" "minimized" will expand. This is a little bit > annoying... > > is it possible to mantain minimized codes also inside "comments"?

Just an idea:

What if you start with the closing brace "}", then add the opening "{"?

DoDi

Reply by email

Kjow
to Martin: The term is "folding". and yes there is a problem with all folded blocks being unfolded,…

2011/3/25 Martin :

Show quoted text 14 lines
The term is "folding". and yes there is a problem with all folded blocks being unfolded, whenever you start a comment. Unfortunately this is not fixed yet. However a few tricks that maybe can help. Depending on OS, you may have to set the keyboard shortcuts in the options first) shift-alt-1 => fold all nodes (pascal nodes, not IFDEF) shift-alt -2 => fold all level 2 nodes (nested nodes) .... shift alt 0 => unfold all also you can write the closing "}" first, but it is very easy to forget....

Thank you, Martin!

Kjow

Reply by email

Martin
to Kjow: Hi all! Everytime I need to comment a part of the code with (e.g. { ... } ) and I have…
Kjow wrote 11 lines
Hi all! Everytime I need to comment a part of the code with (e.g. { ... } ) and I have some parts of code "minimized" with the "-"/"+" on the left of editor (Please excuse me, I don't know the technical term - e.g. http://3.bp.blogspot.com/_UuDt8fZYCTg/TDCZtgbGUqI/AAAAAAAAAQ8/HcoRx10cuE0/s1600/lazarus.png on the left of uses, TForm1, etc), just writing the first "{" every part after the "{" "minimized" will expand. This is a little bit annoying... is it possible to mantain minimized codes also inside "comments"?

Now, supported in the latest svn. Folded code stays folded.

However as long as a fold is in a comment (or otherwise preserved where it would have previously been unfolded), it will not be saved to your session.
That means:
- if you restart the IDE, while you have an unfinished "(*" comment => you lose the folds inside that comment.
- Once you finished the comment, all folds after the "*)" will be normal again, and be preserved.

Oh, and if you go for it. Remember it's a snapshot, it's a new feature, it had some testing here, but you should save your data regulary.

Martin

Reply by email

Kjow
to Martin

2011/4/2 Martin :

Show quoted text 14 lines
Now, supported in the latest svn. Folded code stays folded. However as long as a fold is in a comment (or otherwise preserved where it would have previously been unfolded), it will not be saved to your session. That means: - if you restart the IDE, while you have an unfinished "(*" comment => you lose the folds inside that comment. - Once you finished the comment, all folds after the "*)" will be normal again, and be preserved. Oh, and if you go for it. Remember it's a snapshot, it's a new feature, it had some testing here, but you should save your data regulary. Martin

Hi Martin,
Thank you!

I updated svn to "Lazarus 0.9.30 r30142M FPC 2.4.2 i386-win32-win32/win64" but trying with both "{" OR "(*" folded code after first "open parenthesis" unfolds when I start the comment :(

Kjow

Reply by email

Martin
to Kjow
Kjow wrote 21 lines
2011/4/2 Martin: > Now, supported in the latest svn. Folded code stays folded. > > However as long as a fold is in a comment (or otherwise preserved where it > would have previously been unfolded), it will not be saved to your session. > That means: > - if you restart the IDE, while you have an unfinished "(*" comment => you > lose the folds inside that comment. > - Once you finished the comment, all folds after the "*)" will be normal > again, and be preserved. > > Oh, and if you go for it. Remember it's a snapshot, it's a new feature, it > had some testing here, but you should save your data regulary. > > Martin Hi Martin, Thank you! I updated svn to "Lazarus 0.9.30 r30142M FPC 2.4.2 i386-win32-win32/win64" but trying with both "{" OR "(*" folded code after first "open parenthesis" unfolds when I start the comment :(

it is *not* in 0.9.30
It is only in 0.9.31
http://www.hu.freepascal.org/lazarus/ (links *"without" "fixes" e.g. "Lazarus + fpc 2.4.2 win32
Lazarus-0.9.31-30142-fpc-2.4.2-20110403-win32.exe
<ftp://ftp.hu.freepascal.org/pub/lazarus/snapshots/Lazarus-0.9.31-30142-fpc-2.4.2-20110403-win32.exe>"

The 64 bit snapshot seems for 32 bit:
0.9.31 snapshots with
30142 should be good
30141 is ok, but as long as the fold is commented the [+] symbol is not reacting to clicks

if you want to stay on 0.9.30, then you can just merge 2 revisions 30141 and 30142 (and 30140 for 64 bit)

I attached a patch, (there is one for each of the revisions, so depending on what you download, you apply the rest)

Or you hope that tomorrow there will be a 64 bit snapshot too

Martin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110403/e6f43d47/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: syn_fold_comment_patch.rar
Type: application/octet-stream
Size: 15568 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110403/e6f43d47/attachment-0001.obj>

Reply by email