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. The line separator used by a buffer can be changed in the Utilities>Buffer Options dialog box. See the section called “The Buffer Options Dialog Box”.

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