Lyx does not preserve DOS/Unix line endings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lyx (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I am working on a lyx document together with people that use Windows. Every time I save the document, all line endings get converted to \n (LF). Every time someone on Windows saves the document, all line endings get converted to \r\n (CR+LF).
The document is versioned using SVN which now will show every line as changed in "svn diff". This is unacceptable when merging changes from other people and I always have to use the tool "unix2dos" before committing, so that the diffs look reasonable.
What I expected to happen:
If opened document uses LF to end lines, save document using LF to end lines.
If opened document uses CR+LF to end lines, save document using CR+LF to end lines.
Like most text editors.
What happened instead:
LyX converts the line endings to the format "native" to the platform it is running on.
LyX Version:
This affects all versions prior to and including LyX 2.0.2.
Ubuntu Version:
Description: Ubuntu 12.04 LTS
Release: 12.04
Changed in lyx (Ubuntu): | |
status: | Confirmed → Invalid |
The correct solution to this problem is to use
svn propset svn:eol native <myfile.lyx>
This way windows users will see a file with CR+LF, and unix users will see plain LF.
I agree that LyX could implement what you describe, but that would be a problem for (say windows) users who use an editor (say notepad) which does not honor LF end of lines. It is precisely for these admittedly naive users that we should make as unsurprising as possible. Especially since svn does all the work.
JMarc (LyX developer)