1

I am trying to turn off auto formatting in Eclipse Oxygen 4.7.0 on save. I have tried this solution. I have all perform action on save disabled. (Window-Preferences-Java-Editor-Save Actions- unchecked 'Perform the selected actions on save'. Same for 'Project Specific Settings'. It this a bug or is there a way to fix this?

edit - pictures from settings. (no project specific settings) global projects

Tor
  • 47
  • 11
  • 1
    Are you sure you looked at both the Project specific settings and the global Preferences setting. There is nothing else that controls formatting on save (for Java). – greg-449 Sep 11 '17 at 08:35
  • Yes I have checked this. Edit the original question to prove it. – Tor Sep 11 '17 at 09:28
  • Solved! Thanks for the input. The problem was that I had plugin installed. I uninstalled AnyEdit and CheckStyle. – Tor Sep 11 '17 at 10:48
  • 1
    @Tor AnyEdit does not format the code, but removes trailing whitespace and replaces tabs<->spaces on save. This can be configured/disabled in _Window > Preferences: General > Editors > AnyEdit Tools_. – howlger Sep 11 '17 at 13:17
  • @howlger thank you! My problem was exactly that. Empty lines/tabs were removed. Good tip – Tor Sep 12 '17 at 06:28
  • @Tor I added this as answer for others. – howlger Sep 12 '17 at 07:26

1 Answers1

2

If this is not caused by the Save Actions, then maybe by a plug-in that you have installed.

AnyEdit Tools is the most popular plug-in which removes trailing whitespace by default. This can be configured/disabled in Window > Preferences: General > Editors > AnyEdit Tools.

howlger
  • 31,050
  • 11
  • 59
  • 99