Ticket #40 (new defect)

Opened 4 months ago

Preserve line endings

Reported by: otaylor Assigned to:
Priority: moderate Keywords:
Cc:

Description

The big rewrite of shell_buffer.py that I'm about to commit switches the canonical in-memory representation of a worksheet to a list of lines, with the line endings stripped from each line. (Having to worry about the line ending positions just makes everything harder.)

However, in the current version of the patch this results in a load-save cycle on a worksheet converting it to Unix line endings.

Possible Improvements:

* Autodetect the line-endings in a worksheet on load, preserve them on save.

  • If mixed line endings are encountered, warn the user and let them select what they want.

* Keep a parallel array to the lines array with the line endings for each line. But this is a lot of work to support something (files with mixed line endings) that is inherently evil.