zezollo
zezollo

Reputation: 5017

Prevent atom editor from deleting last blank lines when saving a file

The editor I used previously do not remove automatically blank lines at the end of a file when saving.

The atom editor does it.

Problem is, if I open such a file with atom, do some changes, undo the changes and save, the file will be seen as changed by git, only because of these removed blank lines.

I know I could each time tell git to ignore the change, but it's annoying and I'd prefer not to interfere with git.

Does anyone know a way of preventing atom to automatically delete the blank lines at the end of a file when it saves it? I can't find it in the preferences nor any package providing this feature.

Upvotes: 13

Views: 2961

Answers (1)

Bonanza
Bonanza

Reputation: 1621

  1. Go to: Settings / Packages
  2. Find package whitespace
  3. Click settings in whitespace package
  4. Uncheck 'Ensure Single Trailing Newline'

Upvotes: 18

Related Questions