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 (under IDE Settings)NONE from the dropdown list next to Strip trailing spaces on Save. You can also set it to Modified 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 under IDE Settings)SynchronizationIf 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