tags:

views:

58

answers:

2

Does anybody know how to turn line breaking in eclipse after you press CTRL + SHIFT + F (code format), ex :

System.err
                    .println("Incorrect file name, make sure you include .extension with your file name");
+3  A: 

Go to Window->Preferences->Java->Code Style->Formatter. Create new formatter. Click on edit and then pick tab Line Wrapping and set Line Wrapping policy to Do not wrap.

draganstankovic
@draganstankovic thank you(hvala puno), I also had to increase maximum line width it was set to 80
c0mrade
:)Also in Window->Preferences->General->Editors->Text there is an option "show print margin". If you turn it on you'll always see vertical gray line that shows you when to break to a new line.
draganstankovic
alright thank you again
c0mrade
+1  A: 

In Helios, set 'Line Wrapping/Function Call/Indentation Policy' to 'Indent on Column' for all cases. This seems to stop the pathological case where it splits a line to try and fit within a fixed width but ends up with it further to the right than it would have been unsplit.

Or, as suggested above, disable line wrapping, or set a very wide line width. But I find it better to have it wrap and get it right than not to wrap at all.

soru