Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Extra Lines "ENTER"s get rejected #21

Open
rogerprz opened this issue Mar 23, 2018 · 2 comments
Open

Extra Lines "ENTER"s get rejected #21

rogerprz opened this issue Mar 23, 2018 · 2 comments

Comments

@rogerprz
Copy link

When I click multiple spaces (Enter) they are removed by the autosave. Need to place a # for comment or move something else.

@Shana601
Copy link

I have the same case. I like to add blank lines before starting new contents. If I don't type anything after hitting "Enter" a couple times, the cursor bounces back to the end of the file.

@KuroKensei
Copy link

KuroKensei commented Dec 9, 2019

I have the same problem. However:
The reason for this behaviour lies NOT within autosave-onchange's sourcecode but in the atom default saving behavior!

You can verify this by:

  1. disabling or deleting 'autosave-onchange' and
  2. inserting a few empty lines at the end of your document
  3. use hotkey to save (default: 'ctrl + s')

You will notice that the empty lines at the document end are being erased.

The package responsible is the 'whitespace' package in the atom core/default packages.
To disable this behavior and keep all newlines at the end of the file:

uncheck: Settings > Packages > whitespace > Settings: "Ensure Single Trailing Newline"

Now all newlines will remain at the end of all files.
Note that you can also define this feature language-specific - see settings hint for more details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants