Just like to point out that word wrapping is a terrible idea in code. I suppose everyone has their own style, but typically you should refactor or rethink blocks of code that take much more than a single average horizontal screen. (about 1280 pixels)

Of course there are always exceptions... like verbose exceptions for example, but these are not critical for code understanding.

Scanning a line that goes beyond a single horizontal screen, or having to read a thought that stacks on multiple lines will make your code much more difficult to figure out.

Additionally, line counts will be weird, as word wrapping will make a single line seem like it takes up 2, 3, or shudder the thought... 4 lines of code.

As far as comments go, line returns should not be much of a problem for anyone.

Also keep in mind, word wrapping code is not a common practice, and you are essentially saying that everyone reading your code should turn word wrapping on, which is, I'm sorry to say, an unnecessarily painful thing to make others working with your code do....

If nesting is causing you the need for word wrap... well this is also a very bad code smell.

@Nickolas You are right. Ctrl+Shift+F works better from your point of view because it logically breaks long lines and makes it a beautiful code. Of course, long line is thing to avoid (by definitio), but it is impossible to do so if you call methods where you instantiate some new object with his own parameters, and not to mention if you have to call connecting method via dot (.). Such line is ugly but necessary.
–
sandaloneDec 31 '10 at 18:26

1

@Nickolas Forgot to say that line-wrapping add-on is very helpful when writing such long lines because it's tedious to press auto-format shortcut keys each time you need to look at the whole line. I find that auto-formatting should be done once - in the end of coding one logical piece of code.
–
sandaloneDec 31 '10 at 18:27

3

@askmo I don't think code should be artificially formatted to simulate word wrapping... this is even a worse idea. My main point is that if you are often creating lines of code that span multiple screens, you are doing something wrong. I admit there are always exceptions, but these exceptions should be very rare. Code should first and foremost be clean and understandable, and I find it very unlikely that code that requires word wrap is a code base that is readable.
–
NicholasDec 31 '10 at 18:36

2

Nicholas, I completely agree with you, but in my case I'm editing textile documentation, not code, so in this case it'll become quite useful...
–
opensasNov 8 '11 at 13:07

7

For code I agree, however PHP files can contain HTML which can contain paragraphs of text. Personally I'd rather have the option of keeping these on one line and using a soft word-wrap while editing.
–
Dan BrownJan 6 '12 at 15:19

This is for anyone who is having the following problem with the "Ahtik" word-wrap plugin in Texlipse: the plugin installs fine, but selecting the "word-wrap" option using the context menu (or pressing ctrl+alt+w) causes the text to wrap momentarily, and then just flick back to being unwrapped (this probably includes anyone using Windows 7).

Here is a fix...straight from the developer himself! I emailed Ahti Kitsik in a last-ditch attempt to find a way round, and was amazed when he actually found a solution, and sent it to me the next day. He suggested that in return I could just make this information widely available.

So, the way to fix it as follows:

Look up the texlipse plugin location. This will probably be in the Eclipse folder, and the address will probably end: ...\eclipse\plugins\net.sourceforge.texlipse_1.5.0.

Backup the plugin.xml file there just in case, and then edit the original by deleting the following chunks of code:

(When you have done this, the file should be 1257 lines long, instead of 1271).

Finally, Ahti says: "Start eclipse with -clean command line argument to force reloading of plugin.xml." (Personally I had no idea how to do this, so I just removed and reinstalled his plugin, then exited Eclipse, and edited the code before I restarted it).

The function should work fine now. Hope this helps someone. And thanks again Ahti!

Good job with the answer, but the last line is unnecessary. ("This function... again Ahti!") +1
–
GrammarOct 11 '12 at 16:04

Does anybody understand the point of this comment?
–
AdamOct 11 '12 at 22:19

The "new posts" catagory requires you to leave a comment before saying 'I'm done'
–
GrammarOct 12 '12 at 12:18

I've tried this but it doesn't work ;/ Using latest eclipse, texeclipse, and ahti. I did eclipse -clean. When using "word wrap" from the properties it seems to work but then a second later returns to the way it was. I can use the "correct line wrap" to good effect but it only seems to work per paragraph, and I guess is hard wrapping.
–
jsmdnqDec 30 '12 at 18:16