Reformat File changes spaces into tabs

已回答

Problem:

Whenever I use the "Reformat File" option, it changes my indent spaces to tabs, even though I disabled the "Use tab character" in the settings.

Reproduction:

I've a file completely indented with tabs. I delete the tabs in front of a line and press tab on the keyboard, it now has 4 spaces in front. I run the "Reformat File" feature and it changes the spaces back to tabs.

Settings (Scheme "Project" for Project Settings and "Default" for IDE Settings, both are the same):

Editor -> Code Style: Detect and use exisitng file idents for editing: Disabled
Editor -> Code Style: Enable EditorConfig support: Disabled (and no .editorconfig file anyway)
Editor -> Code Style -> Java: Use tab character: Disabled

IntelliJ IDEA version: 2017.3.4 Ultimate

Is there another setting I am missing?

1

Oh boy, the moment I've sent this I remembered, that I have the Eclipse Code Formatter plugin which seems to overwrite everything.

1

:) Thank you, same here... Still very useful post. :)

0

Hmmm... but mine is disabled for the project I am having issues with.... :) So did not help... Will look further.

0

You can also try disabling EditorConfig in the IDE settings: Settings (Preferences on macOS) | Editor | Code Style | Enable EditorConfig support.

1

Thank you Sergey, it helped. Was not aware of such feature.
Спасибо большое. :)

0

请先登录再写评论。