I'm trying to configure the Java code formatter to have a compact formatting. I've set the policy to "Wrap where necessary", and maximum line width to 80, but either it wraps where it shouldn't, or it doesn't wrap where it should... Here is an example of what I get:
// -------------------------------------------------------------------------80->
public class FormatterTest {
void test() {
int i, a = 1, b = 1, c = 1, d = 1;
i =
a
* b
* c
* d
* (100000000 + 100000000 + 100000000 + 100000000
+ 100000000 + 100000000 + 100000000 + 100000000 + 100000000);
}
}
// -------------------------------------------------------------------------80->
And what I'd like:
i = a * b * c * d * (100000000 + 100000000 + 100000000 + 100000000
+ 100000000 + 100000000 + 100000000 + 100000000 + 100000000);
Thanks for your help.
You can suppress the formatting if you add an // at the end of the line:
i = a * b * c * d * (100000000 + 100000000 + 100000000 + 100000000 //
+ 100000000 + 100000000 + 100000000 + 100000000 + 100000000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With