HiveBrain v1.2.0
Get Started
← Back to all entries
patternjavaCritical

Eclipse: Set maximum line length for auto formatting?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
formattingautolinesetmaximumforlengtheclipse

Problem

I am working with Java. If I hit Ctrl+Shift+F in Eclipse Helios, it will auto format my code. At a certain point, it wraps lines. I would like to increase the maximum line length. How can I do this?

Solution

In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the primary option for line width (Maximum line width:). In the Comments tab you have a separate option Maximum line width for comments:, which will also need to be changed to affect comment wrapping.

You will need to make your own profile to make these changes in if you using one of the [Built-in] ones. Just click "New..." on the formatter preferences page.

Context

Stack Overflow Q#3697287, score: 732

Revisions (0)

No revisions yet.