So when I use shift+ctrl+f
to reorganize a class I have the following happen to my one-line if statements
if (true) doThis();
changed to
if (true)
doThis();
How can I make shift+ctrl+f
auto organize to be like the first statement?
Go to Source | Format Document or press Ctrl+Shift+F.
In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the primary option for line width (Maximum line width:).
If you are using multi-line comments (/* */), the fix to prevent Eclipse from applying its auto-formatting is very simple: just add a dash (-) after the asterisk at the beginning of the comment (see below).
After some more exploring it seems I can change it.
preferences
in EclipseJava
Code Style
Formatter
Edit
Control Statement
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