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.
In Preferences > Editor > Code style > [language] uncheck reformat on file save .
To toggle between tabs and spaces: On the main menu, choose Edit → Convert Indents, and then choose To Spaces or To Tabs respectively.
Pin or unpin a tab To pin or unpin an active tab, right-click it and select Pin Tab or Unpin Tab from the context menu. To close all tabs, but the pinned ones, right-click any tab and select Close All but Pinned.
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.
There is an option 'keep indents on empty line'
Assuming Java: Settings > Code Style > Java > Tabs and Indents > Use tab character
. You can do the same for other languages too.
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