Reputation: 2816
How do I keep eclipse from wrapping multiline comments in Java when using /* ... */?
For example, Eclipse will take this:
/*
// Old code, don't use
for( int i = 0; i < myarray.length(); i++){
myarray[i].haveFun();
}
*/
And turn it into this:
/*
// Old code, don't use for( int i = 0; i <
myarray.length(); i++){ myarray[i].haveFun();
}
*/
Upvotes: 0
Views: 127
Reputation: 2376
Eclipse formatter -> "Off/On Tags" -> Enable. Then use comments, for example:
// @formatter:off
...
// @formatter:on
Upvotes: 2
Reputation: 111142
Go to Preferences > Java > Code Style > Formatter
and select Edit...
on the active profile.
Switch to the Comments
tab and enter a large value for the Maximum line width for comments
value
Upvotes: 1
Reputation: 665
http://www.wikihow.com/Change-the-Default-Format-Settings-in-Eclipse
The article explains how to do exactly what you want and more.
Upvotes: 0