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

http://slashdot.org/comments.pl?sid=165492&cid=13808398

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.
MarkDBlackwell
 
Posts: 1
Joined: Tue Apr 23, 2013 7:34 pm

Re: Make saving newline_at_eof the installation default

Postby Thomas Jensen on Fri May 23, 2014 11:52 pm

MarkDBlackwell wrote: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.


I would like to vote for this feature as well.
Thomas Jensen
 
Posts: 2
Joined: Wed Oct 17, 2012 4:33 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 40 guests