We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Code Folding (Read 2842 times)
Code Folding
Jun 23rd, 2007, 3:31pm
 
Hello,

I am very impressed with Processing. It makes coding fun. I would like to contribute to the development process by adding a feature that would make things easier (for me, potentially for others too)...

I have the bad habit of writing verbal code. Soon the processing text area gets jammed and the scroll bar get tiny. I would like to add some sort of code folding mechanism (see jEdit).

I am thinking of a simple parser hack like an indentation recognition or a comment parser, say

//fold stuff
 code
//unfold

Can anybody explain how to mess up with the processing code?  to achieve something like that?

best,
-Stelios
Re: Code Folding
Reply #1 - Dec 30th, 2009, 7:11pm
 
what happend to this idea? i really like it and would love to see that implemented. Could something like this be achieved by a tool? probably not i guess... to bad, but its definitely a feature i would love to see in the future.
Re: Code Folding
Reply #2 - Dec 31st, 2009, 2:38am
 
A Scintilla-based editor (for example), like SciTE (which I use daily) or Notepad++, have code folding built into the lexer (the stuff coloring the code depending on language's syntax).
In general, folding is done on code blocks. For Java, it folds on braces {} so you can "hide" the content of setup(), draw() or whole classes for example.
Note that you have something similar in Eclipse, among others.

AFAIK, it must be built in the editor itself, so it can still track on which line we are, unfold code where an error is reported, etc.

I was tempted to hack a bit the current editor, as there are some unsatisfying limitations (eg. Shift+Tab doesn't work on a single line!) but I don't know if it is worth it, there are rumors about replacing it with something more elaborated (like Eclipse's editor?).
Re: Code Folding
Reply #3 - Dec 31st, 2009, 3:43am
 
Right, the folding on braces {} would be useful also the possibiltie to add folding parts yourself. I know other IDEs have these feautures. i tried to switch several times to different ones, like eclipse but always returned to the original processing IDE. Its fine for most of my needs and i actually like the simplicity of it. It only lacks some features.

what do you mean by Quote:
rumors about replacing it with something more elaborated (like Eclipse's editor?).


casey told me that the next big changes on processing will be openGL and after that it is planned to work on the IDE itself. I hope at least some of the features will be implemented then...

Is there actually a list of suggested features? that probably would be really useful.
Page Index Toggle Pages: 1