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.
IndexSuggestions & BugsSoftware,  Documentation,  Website Suggestions › Code Editor Request: Word/Line Wrapping
Page Index Toggle Pages: 1
Code Editor Request: Word/Line Wrapping (Read 2506 times)
Code Editor Request: Word/Line Wrapping
Sep 21st, 2008, 8:58pm
 
Would be nice if the Code Editor features a line/word wrapping option. Optimally this function can be quickly toggled with a keyboard shortcut.

I consider manual line breaks very old fashioned because they are inflexible whereas runtime generated line-wrapping is much more environment flexible. The computer is a highly adaptable ("fluid") medium, we should fully utilize this potential and thus only use static information as CR/LF where necessary Smiley

Thanks!
Re: Code Editor Request: Word/Line Wrapping
Reply #1 - Sep 23rd, 2008, 12:46am
 
While it could be nice to have, I don't feel a string urge on this feature, as we rarely write very long code lines. Are we?
Re: Code Editor Request: Word/Line Wrapping
Reply #2 - Sep 29th, 2008, 4:12pm
 
My code lines usually fit within those 80 something characters, except if I have many arguments.

BUT: My comments are sometimes longer. And I hate to manually break text or to often have the necessity to horizontally scroll.

As already mentioned in my opening posting, I break into semantic pieces only (paragraphs), but never because of the technological environment.

I hope that this very conservative, and meanwhile useless approach of "manual line breaking", which still happens in some digital realms -- i.e. plain text emails, Gutenberg.org  eBooks, etc -- will finally end one day!

Personal computers are no stupid teletypes or terminals anymore, which print over the paper margin if a CR/LF is missing, but very flexible media!

Please adjust! And use the resulting flexibility and freedom!
Re: Code Editor Request: Word/Line Wrapping
Reply #3 - Oct 2nd, 2008, 2:54pm
 
Funnily, I just got a phone able to display text or PDF or Office files on its small screen.
And I feel your pain, as the phone doesn't reformat to fit the screen, so I have to scroll horizontally and vertically to attempt to read: unusable! Wink

Of course, I perceive your request as reasonable (I have set a shortcut on my favorite editor to trigger on/off wrapping...), but I fear it will be seen as low priority feature from the PDE developers (which I am not! although I took a look at the editor, as I would like to improve it too).

Now, I am not the one setting roadmaps for Processing! :-D

Side note: one issue with wrapping for code is that it can be ugly. So either you avoid wrapping outside of comments, as you point out, you cope with ugliness, or you hope for smart wrapping...

Ascii art example:

......FunctionCall(param1, param2, param3, param4)

can be wrapped (by default, eg. in Notepad) as:

......FunctionCall(param1, param2,
param3, param4)

or smartly as:

......FunctionCall(param1, param2,
..........param3, param4)
Re: Code Editor Request: Word/Line Wrapping
Reply #4 - Oct 2nd, 2008, 4:42pm
 
The Smart Wrap which you describe, is what I propose! Very desirable!

If the PDE editor does not get this change, then I will sooner or later investigate on how to use other text editors with Processing code. I am sure there is enough explanation on this within the forums.
Re: Code Editor Request: Word/Line Wrapping
Reply #5 - Oct 2nd, 2008, 4:59pm
 
I think the problem with this lies with the saving.
As of now, I believe that Processing saves what you see, thus saving with wordwraps.
Of course, that's not really a problem, but if you want to toggle it, it might be.
I was thinking of making a tool for it, but I'm guessing I'd run into the same problem there.

could always have a bool, and if it's wrapped, unwrap it before exit.. should work as a tool even.

seltar
Re: Code Editor Request: Word/Line Wrapping
Reply #6 - Oct 20th, 2008, 11:40am
 
Dear Seltar!

Of course what is saved and what is displayed have to be 2 different sets of data. But this seems already to be the case in the PDE editor.

Saved Data: If you open a .pde file in another texteditor, it is just a plain text file, using space characters for indentation.

Displayed Data: The PDE editor makes syntax highlightning. This is generated while runtime. The word wrapping could be runtime generated as well.
Page Index Toggle Pages: 1