Atom adds new line on save. #3725
Comments
Yeah, it's a feature -- you can disable that behavior in the settings for the Whitespace package. Open Atom Settings, and scroll down until you see the Whitespace package, and then uncheck "Ensure single trailing newline". |
Like how this "feature" looks like a bug. |
I think this should be considered a bug. If a user opens an existing file that doesn't have a trailing newline, modifies some text in the middle of the file, and saves, I'd bet you the user won't expect (or want) a new line to be added to the end of the file. |
Why should a file end with a newline? |
@izuzak can you reopen this issue for consideration given the above feedback? |
@vmaha please see atom/whitespace#111 (comment), and for future reference whitespace-related issues should be reported to the whitespace package. |
@50Wliu thanks for the link. sad to hear that, but you guys are doing a great job otherwise, so i respect your decision. |
@vmaha @denysvitali If you're curious for the context behind why files should end with a newline, take a look at this Stack Overflow answer: http://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline/729795#729795 |
@mnquintana We're not objecting to the general principle. We're objecting to enforcing the principle on already existing files, without any indication to to the user. IMO a better solution would be to enforce this rule for new files only. Or, if you want to enforce it for existing files, then indicate that you've cleaned the file, and provide an affordance for the user to [undo], and [disable rule] whenever this is done. |
@mnquintana Seems a good reason, thanks! |
It's back now. But without |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks! |
Hi.
When saving a file, atom adds a new line character at the end of a file.
Is it issue or a feature?
Ubuntu 14.04. Atom 0.134.0.
The text was updated successfully, but these errors were encountered: