I have a file that contains "mixed" line-endings, i.e. both
CRLF. This is because the file is a mixture of plain text that also has binary data interspersed.
I'm looking for a text editor that doesn't normalize line-endings whenever saving (i.e. leaves the newlines unchanged in the file). It seems most/all text editors convert all new-lines in a file to be the same after the first time you save.
Normally I'd use a Hex editor for this, but in this case I have to mostly edit the text and make changes on a per-line basis and I also don't know of a hex editor that shows text with new-lines for editing (i.e. splits the rows on newlines).
Another implied requirement is that the editor shouldn't affect any parts of the file that weren't edited, e.g. by re-encoding etc., but I've found this is usually only an issue with these files when UTF-8 (or any variable length) encoding is assumed by the editor, so setting the encoding to e.g. ISO 8859-1 seemed to work to prevent this.
Text editors I've tried:
nano (see mail),
xed, Visual Studio Code (see github issue), Sublime Text (see discussion)
Hex editors I've tried: GHex, Bless Hex Editor, Okteta, wxhexeditor