Reputation: 183
How to disable auto changing tabs to spaces and removing empty lines, whitespaces in the sourcefiles after it opened?
In other words if the line contains tabs and spaces in one line Idea shouldn't change them. For example if file contains "-->-->....-->public void setAttribute();" Idea shouldn't change tabs to spaces or spaces to tabs. I can disable all autoformattig.
Upvotes: 12
Views: 13874
Reputation: 1041
In Editor - Code Style - Java/JSON/etc - Tabs and Indents are two checkboxes:
Upvotes: 0
Reputation: 71
Besides noted IDE settings, please check if .editorconfig file exists in your project. The file may silently override IDE settings.
Upvotes: 0
Reputation: 129
To restate the problem, you want the editor to not affect the whitespace indentations. Spaces should remain spaces and tabs should remain tabs.
I'm having a similar problem. It looks like IntelliJ has this feature:
Settings > Editor > Code Style
,
Indents Detection
section,
Detect and use existing file indents for editing
option
Unfortunately, I don't think I can get it to work as expected for myself (version 2016.3.6), but it seems to be working for others.
Here's the original jetbrains blog post about it.
Upvotes: 5
Reputation: 2993
Assuming Java: Settings > Code Style > Java > Tabs and Indents > Use tab character
. You can do the same for other languages too.
Upvotes: 1