Reputation: 13007
Sometimes I like to space an expression non-uniformly. E.g., I prefer...
x*x + y*y
...to...
x * x + y * y
It seems that the Eclipse formatter won't allow this. I can tell it to put either zero or one space around every operator, but I can't see how to make it leave the spacing as I wrote it. Can this be done? (@formatter:off
is too intrusive.)
Upvotes: 0
Views: 331
Reputation: 117589
Go to:
Window -> Preference -> Java -> Code Style -> Formatter -> Edit -> White Space -> Expressions -> Operators
and then check the following 2 check boxes:
☑ before binary operators
☑ after binary operators
Upvotes: 0