How to make Rider 2019.1.1 to NOT format whitespace in all file?



I am using JetBrains Rider 2019.1.1 in MacOS with C#, and every time I alter a source file, git detects a lot of whitespace changes in ALL file that I did not do that are very annoying.

The files are from a repository, and I do not know in which IDE were written (VS 2017 probably), but I do not want to reformat the file's whitespaces. I just want to modify the parts I am interested at. 

How can I tell Rider to stop messing with the whitespaces ?

I do not want to ignore whitespace changes as GitHub diff can do, I want Rider to stop making such changes.



Please try to set 'File | Settings | Editor | General | Strip trailing spaces on Save' to None and on File | Settings | Editor | Code Style | C# | Spaces tab change the Preserve Existing Formatting > Extra spaces insidesetting to Leave all extra spaces and tabs. 

Is that are you looking for? 


I do not have "Settings" but "Settings for New Solutions" in the "File" menu.

I went to "JetBrains Rider" menu, and click on "Preferences" (which went to the same place) and changed that setting, but Rider keeps messing all the whitespaces.


I just realised it is messing with the line breaks, probably because the files originated in a windows system. However I cannot find an option to stop Rider from changing them.


Could you please update Rider to the latest 2019.2.2 version? 

You can also try to in the `Commit Changes` window the `Ignore whitespaces (and empty lines)` setting.  

Could you please attach some examples (files or screenshots) illustrating the problem? 



The same problem in HTML. How to stop delete whitespaces automatically? I want to commit changes ONLY for lines I modify. 


Any update on this issue?

I'm having the same problem with C++.

It looks like only the C# language has the full control over the whitespace preservation settings.

Note that it's considered bad coding practice to do unrelated formatting changes all over the file while you're modifying only certain lines in the file (i.e. mixing formatting and logic changes, creating problems with code merges,...). This should never be the default behaviour.


Is there a chance that you have "Remove trailing spaces on" configured under Preferences | Editor | General (On save) section?


Please sign in to leave a comment.