Prevent deletion of atom editor by last empty lines when saving file

The editor I used earlier does not automatically delete empty lines at the end of the file when saving.

The atom editor does this.

The problem is that if I open such a file with an atom, make some changes, discard the changes and save, the file will be seen as changed to git, only because of these deleted empty lines.

I know that every time I can tell git to ignore the changes, but this is annoying, and I would prefer not to interfere with git.

Does anyone know a way to prevent an atom from automatically deleting empty lines at the end of a file when it saves it? I can not find it in the settings and in any package that provides this function.

+7
source share
2 answers
  • Go to: Settings / Packages
  • Find Batch Spaces
  • Choose settings in batch package
  • Uncheck the box next to "Ensure a single ending newline"
+12
source

using regex find

^(?:[\t ]*(?:\r?\n|\r))+ 

Click Find All and Replace All

0
source

Source: https://habr.com/ru/post/1245495/


All Articles