xmen
xmen

Reputation: 1967

Configure Eclipse to avoid comments wrapping

When I'm writing code, I keep format it using CTRL + SHIFT + F. Everything works fine except comments, Eclipse wrapes comments and its very annoying. I just want single line comment, no matter how long it is.

For example

void SomeMethod()
{
    int someValue = 155; // This value is for blah blah blah blah
}

after format

void SomeMethod()
{
    int someValue = 155; // This value is 
                         // for blah blah 
                         // blah blah
}

Now its taking 3 lines for nothing.

I'm using Eclipse 3.7.2, anyway to fix it ?

Upvotes: 0

Views: 72

Answers (1)

Ken Chan
Ken Chan

Reputation: 90447

  1. Preferences -> Java -> Code Style -> Formatter
  2. Choose the current active formatter profile , press edit and you will the following screen.
  3. The Comments tab contains all the stuff about comments formatting. Set the Maximum line width for comments to a very large number.

enter image description here

Upvotes: 2

Related Questions