PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Eddy Van Esch on December 03, 2013, 05:45:04 PM

Title: Code Editor: Hide/Unhide comment lines
Post by: Eddy Van Esch on December 03, 2013, 05:45:04 PM
Hi Paul (and others),

Got a new feature request, perhaps even more awkward than my previous ones   ;D

To document my code, I hardly touch a page of paper. I write it all in the source code files as comments.
Most of my source code files have 50% or more of comment lines in it.
This helps me to maintain my code later.
However ... it also has a disadvantage. When debugging, the many comment lines prevent me to have a good overview of my code. Therefore, I sometimes copy/paste pieces of code in a Word document, remove all of the comment lines and print out the remaining code.
It would be a big help if FF would have a functionality (somewhat simular to the 'function fold/expand' feature) to temporarily hide all the comment lines. A complementary function to unhide/show the comment lines again.
Hiding only the lines with nothing-but-comment would suffice. Comment at the end of a code line can remain in place.

Am I weird for asking for such a feature?  :o  ;)

Kind regards





Title: Re: Code Editor: Hide/Unhide comment lines
Post by: Rolf Brandt on December 04, 2013, 04:41:21 AM
I don't know why but I thought I had read somewhere that the FF editor supports regions. If so I cannot find it anymore.

Basically FF3 does support foldable regions - the keywords SUB...END SUB or FUNCTION...END FUCTION create foldable regions.

In the Basic4Android this feature is implemented like this:
#Region  JustaComment
'Comment 1
'Comment 2
#End Region


Maybe Paul could implement a keyword #COMMENT MyComment...END COMMENT and a function to close all comments.

Rolf

Title: Re: Code Editor: Hide/Unhide comment lines
Post by: Eddy Van Esch on December 04, 2013, 04:50:37 AM
Quote from: Rolf Brandt on December 04, 2013, 04:41:21 AM
Maybe Paul could implement a keyword #COMMENT MyComment...END COMMENT and a function to close all comments.
Using a keyword is not necessary, Rolf.
FF can already recognise a comment-only line because (ignoring leading spaces) it always starts with REM or single quote.
Having to add additional keywords would actually increase the clutter on the screen  :)
Title: Re: Code Editor: Hide/Unhide comment lines
Post by: Rolf Brandt on December 04, 2013, 05:00:15 AM
You have a point there, Eddy.

My idea was to just fold multiline comments and leave a descritive line. Like this one could easily unfold just that one comment if needed. Single line comments would not be affected.

Rolf