[Lazarus] Commenting.

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Commenting.

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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Kjow
2011/3/15 Kjow <[hidden email]>:

> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting. [folding]

Martin Frb
On 25/03/2011 09:03, Kjow wrote:

> 2011/3/15 Kjow<[hidden email]>:
>> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Hans-Peter Diettrich
In reply to this post by Kjow
Kjow schrieb:

> 2011/3/15 Kjow <[hidden email]>:
>> 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


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting. [folding]

Kjow
In reply to this post by Martin Frb
2011/3/25 Martin <[hidden email]>:

> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Kjow
In reply to this post by Hans-Peter Diettrich
2011/3/25 Hans-Peter Diettrich <[hidden email]>:
> Just an idea:
>
> What if you start with the closing brace "}", then add the opening "{"?

It is the way I already follow, but sometimes I forgot it... :p

Kjow

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Martin Frb
In reply to this post by Kjow
On 15/03/2011 10:16, Kjow wrote:

> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Kjow
2011/4/2 Martin <[hidden email]>:

> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Martin Frb
On 03/04/2011 10:07, Kjow wrote:
2011/4/2 Martin [hidden email]:
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"

The 64 bit snapshot seems missing at current. as 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


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

syn_fold_comment_patch.rar (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Commenting.

Kjow
2011/4/3 Martin <[hidden email]>:
> it is *not* in 0.9.30
> It is only in 0.9.31

Thank you Martin!

Kjow

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus