Home Download Buy Blog Forum Support

Make saving newline_at_eof the installation default

Make saving newline_at_eof the installation default

Postby MarkDBlackwell on Tue Apr 23, 2013 7:59 pm

It is a general, widely known practical observation that (at least some) people will leave (at least some of) their software preferences alone after installation.

Upon installation currently, the preference is set to false, for whether a newline is ensured at EOF when saving.

This installation default is wreaking a small degree of havoc with programmers using version control software including git, by causing back-and-forth, last line change noise.

Of course, if anyone wants to customize installations to have no newlines at EOF, that's fine because the problem is their own responsibility, on their own heads. But this shouldn't be the default, because of the noise problem it causes.

The reasonable and usual practice of software in Unix and elsewhere is to expect, and to maintain, that all lines end with a newline. This includes the final line. For more information, here are two links:

http://stackoverflow.com/questions/7296 ... -a-newline


To be more precise, after installation, in Default/Preferences.sublime-settings these statements occur:

// Set to true to ensure the last line of the file ends in a newline
// character when saving
"ensure_newline_at_eof_on_save": false,

This should be changed instead so after installation automatically the statements are:

// Set to false to ensure the last line of the file does not end in a newline
// character when saving
"ensure_newline_at_eof_on_save": true,

Further, the editor must not display a new empty line after saving as it does now when this preference is set to true. This even though there is a final newline.

This may be because the editor may be treating newlines erroneously as line separators and not correctly as line terminators. This possibility is described in the links above.
Posts: 1
Joined: Tue Apr 23, 2013 7:34 pm

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 24 guests