andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Allow option for "always end in EOL" #138

Closed yajo closed 10 years ago

yajo commented 10 years ago

Allow to choose to automatically ensure that every file ends in EOL (like \n) before saving.

andreikop commented 10 years ago

Enki always saves files with EOL symbols, which you see on the top-right corner. If EOL autodetection is disabled - all files will be saved with EOL chosen in the settings. i.e. \n. Should this behavior be changed?

yajo commented 10 years ago

No, that's right; the point is adding an option to ensure that the last character in the file is always the corresponding EOL. Some coding standards require this. See for example http://stackoverflow.com/questions/72271/no-newline-at-end-of-file-compiler-warning or http://pep8.readthedocs.org/en/latest/intro.html (search for W292 there).

Thanks!

andreikop commented 10 years ago

Enki always terminates the last line with EOL, and never leaves empty lines at the end of file.

yajo commented 10 years ago

Enki always terminates the last line with EOL

Oops you are right, my bad. Sorry for the mistake.

never leaves empty lines at the end of file.

This is off-topic but I tested this and it does leave empty lines at EOF if there are several.

As always, thanks a lot!