Home Download Buy Blog Forum Support

All Line Endings are coverted on file save

Re: All Line Endings are coverted on file save

Postby jps on Thu May 03, 2012 4:45 am

There is no way to avoid line ending normalization, nor will there be in the future. Support may be added to preserve CR characters, but this isn't the same thing as supporting mixed line endings: CR characters would appear as actual characters in the buffer.

Mixed lined endings are something that is going to create issues for many tools. For example, many unix tools won't handle it, and compiling code with mixed line endings in Visual C++ on Windows will result in incorrect line numbers in error messages.
jps
Site Admin
 
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Re: All Line Endings are coverted on file save

Postby tack on Wed Oct 10, 2012 9:35 pm

jps wrote:Support may be added to preserve CR characters, but this isn't the same thing as supporting mixed line endings: CR characters would appear as actual characters in the buffer.

This would be perfectly fine for me. Is this possible yet? I looked briefly but didn't see any options or plugins for this.

It's not acceptable to code reviewers that my patches include changes to whitespace, and I'm not really in a position to make sweeping cosmetic changes to all files that have spurious CRs (and there are many). I can sort of deal with it with "git add -i" but it's an inconvenience so I'm hoping for way to preserve CRs.

Cheers!
tack
 
Posts: 17
Joined: Sat Sep 29, 2012 7:33 pm

Re: All Line Endings are coverted on file save

Postby tomeeec on Tue Feb 19, 2013 1:05 pm

Unfortunately, missing the option, which can stop line ending normalization, is the reason to terminate my using Sublime Text. Why there is so difficult (for anyone) decision to choose system unmixed line ending? Is it really right way to give free hands to user what to do with his file?
tomeeec
 
Posts: 1
Joined: Tue Feb 19, 2013 12:46 pm

Re: All Line Endings are coverted on file save

Postby puccet on Mon Jun 29, 2015 4:30 pm

There's a critical type of file which require an editor to don't touch what is not modified by the user, shell script with embedded binary files, I create a lot of this files to make self contained installation package for some linux projects and any time i open such files with ST to check inside or do some customization it convert also the 0x0D to 0x0A inside the binary part of the file, this corrupt the files making them unusable and all powerful features of ST useless in this case.

As a rule of thumb i think that any editor should absolutely to avoid to apply any modification to a file if not explicitly edited by the user, this is simply because it cannot know what the user is doing. The assumption that any user editing a file would require to have line ends automatically managed by the editor is simply wrong.
puccet
 
Posts: 3
Joined: Wed Jun 25, 2014 10:44 pm

Previous

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 24 guests