I upgraded to Luna and have a problem with auto-formatting, more specifically auto-indentation. The About Eclipse dialog verifies that I am running 4.4.0.
When the code auto-indents on save, it seems to jump back and forth between two different ways of indenting it regarding the number of spaces. Note the level of indentation:
doSomething( "arg0",
"arg1" );
and
doSomething( "arg0",
"arg1" );
This is extremely annoying when using SCM like git. What's causing this? How can it be fixed?
You can use Ctrl + Shift + F which will run your formatter on the file and fix indentations along the way also.
I found this bug reported here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=434962
The fix mentioned there is to uncheck "Correct indentation" in the save actions. Weirdly, it will still correct indentation, but the bug is gone.
Update: Eclipse Mars also has some issues. One bug can be found here. As a workaround, see here how to use the old formatter in Mars.
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