Provide option to opt out of line ending normalisation for files
See original GitHub issueUpon saving a file edited with VS Code, it appears to perform line ending normalisation automatically and without user notification of any sort. Because of this, I’ve found myself bitten by large diffs in Git (I’m aware you can circumvent this using the -w flag) where a trivial fix to a single line of source code appears to affect a significant proportion of the file, which makes pull requests and reviews for such changes on GitHub a pain to sift through. Then again, I guess one could argue why a source file with mixed line endings should stay in version control like that anyway!
Visual Studio Community displays a prompt upon opening a file if it has mixed line endings and lets a user decide whether or not to have it fixed.

Version: 0.10.1
(By the way, great work on open sourcing VS Code too, thanks!)
Issue Analytics
- State:
- Created 8 years ago
- Reactions:82
- Comments:51 (2 by maintainers)

Top Related StackOverflow Question
EOL normalization should be optional feature and off by default. We do not expect file editor will change non-edited code without user conscious.
Thanks
Concrete examples where this is a problem (from this thread):
.gitignorefiles withIcon\r\rlines in VS Code will break these files behavior (in any case everyone has to be aware of the issue to make the workaround of usingIcon?work)My own example: files for tests (since some external systems work with differnet line endings) cannot be edited in VS Code. If for some reason I have to edit a testfile with mixed line endings I will lose what a test case is supposed to test.
I don’t know if about 10 different examples collected over 5 years is enough to persuade somebody to work on this. But it’s a persistent open issue and therefore should at least be reevaluated, imho. I for one would love to hear some member giving this another look.