My Android Studio will continuously and automatically delete trailing white spaces. Particularly if it's a blank line with nothing but white spaces. I can even add the spaces back in manually and it'll get rid of them again right in front of me within minutes.
This is causing an issue for me because I am working on a large project that has been around for a while and our diff system shows changes all over the place as a result (our diff system doesn't have an option to turn it off and we can't switch systems). This makes code review more difficult and is causing headaches as a result.
How can I prevent Android Studio from doing this? I can't find it in the settings.
Thanks
You can disable it as follows:
File -> Settings
)Editor
tab (underIDE Settings
)NONE
from the dropdown list next toStrip trailing spaces on Save
. You can also set it toModified Lines
since that would also fix the problem for your specific needs.The reason it happens automatically is because it saves changes automatically when idle. You can change this behavious as follows:
General
tab (also underIDE Settings
)Synchronization