Line Separators

Unix systems use newlines (\n) to mark line endings in text files. The MacOS uses carriage-returns (\r). Windows uses a carriage-return followed by a newline (\r\n). jEdit can read and write files in all three formats.

The line separator used by the in-memory representation of file contents is always the newline character. When a file is being loaded, the line separator used in the file on disk is stored in a per-buffer property, and all line-endings are converted to newline characters for the in-memory representation. When the buffer is consequently saved, the value of the property replaces newline characters when the buffer is saved to disk.

There are several ways to change a buffer's line separator:

By default, new files are saved with your operating system's native line separator. This can be changed in the Encodings pane of the Utilities>Options dialog box; see the section called “The Encodings Pane”. Note that changing this setting has no effect on existing files.