Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

atom-editor

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.

like image 634
zezollo Avatar asked Mar 21 '16 15:03

zezollo


People also ask

How do you get rid of trailing whitespace in an Atom?

The "Remove Trailing Whitespace" option is on by default. This means that every time you save any file opened in Atom, it will strip all trailing whitespace from the file. If you want to disable this, go to the whitespace package in your settings panel and uncheck that option.

How do you delete a line in Atom?

To remove the horizontal line, go to Settings => Packages, find and disable a "wrap-guide". Then go to Settings = > Editor, choose a "Soft Wrap".

How do I delete a file in Atom?

Usage. There is no key binding by default to avoid accidental deletes. There is also a menu item (under Packages -> Delete Current File -> Delete) that activates the command.


1 Answers

  1. Go to: Settings / Packages
  2. Find package whitespace
  3. Click settings in whitespace package
  4. Uncheck 'Ensure Single Trailing Newline'
like image 138
Bonanza Avatar answered Sep 21 '22 07:09

Bonanza