Reputation: 489
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?
Upvotes: 9
Views: 5625
Reputation: 18569
Try this :
Upvotes: 4
Reputation: 489
After some more exploring it seems I can change it.
preferences
in EclipseJava
Code Style
Formatter
Edit
Control Statement
Upvotes: 8
Reputation: 3241
Upvotes: 3
Reputation: 103
Rather than use CTRL + SHIFT + f, you might try using CTRL + I (as in Ireland) It doesn't actually reformat the code, but does fix all indents and whitespaces, so it won't affect one line if statements.
Upvotes: 1