11

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?

Jean-François Savard
  • 20,626
  • 7
  • 49
  • 76
Ingo Bürk
  • 19,263
  • 6
  • 66
  • 100

1 Answers1

19

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.

Ingo Bürk
  • 19,263
  • 6
  • 66
  • 100
  • 3
    Thanks. I think in my case the indentation is still working because of the formatter (which is configured to run on save and it has indent features). – Eyad Ebrahim Aug 07 '14 at 13:11
  • This was also driving me crazy. My formatter was also configured to apply indentation. That must be the issue – Fernando Miguélez Jun 17 '15 at 07:35