Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

insert_final_newline property #4

Closed
sindresorhus opened this issue Mar 4, 2014 · 11 comments · Fixed by #106
Closed

insert_final_newline property #4

sindresorhus opened this issue Mar 4, 2014 · 11 comments · Fixed by #106
Assignees

Comments

@sindresorhus
Copy link
Owner

http://editorconfig.org

insert_final_newline: set to true ensure file ends with a newline when saving and false to ensure it doesn't.

See #3

@kevinSuttle
Copy link

Any reason you recommend setting this to false for Markdown files?

@sindresorhus
Copy link
Owner Author

I don't. I do for #3 though, since Markdown requires to trailing spaces for linebreak.

@JaKXz
Copy link

JaKXz commented Jan 10, 2015

It appears that this setting isn't taking effect for me on Atom 0.169.0 with v0.2.3 running on OSX 10.10.1.

@sindresorhus
Copy link
Owner Author

@JaKXz Of course it isn't. It's not implemented yet. Hence this issue...

@JaKXz
Copy link

JaKXz commented Jan 10, 2015

Oh. That's odd, I could swear I'd seen it working before [and I had disabled Atom's whitespace plugin]... but obviously I was just seeing things. Sorry for the noise.

@jerone
Copy link

jerone commented Mar 17, 2015

@JaKXz commented on 10 jan. 2015 06:31 CET:

Oh. That's odd, I could swear I'd seen it working before [and I had disabled Atom's whitespace plugin]... but obviously I was just seeing things. Sorry for the noise.

atom-beautify supports this:

Js end with newline

@anthonyryan1
Copy link

Subscribing. Interested in this for insert_final_newline = false on hand-optimized SVG files (saving as many bytes as possible).

@sindresorhus
Copy link
Owner Author

@EloB Please read the thread before commenting... #4 (comment)

@florianb florianb self-assigned this May 2, 2016
@florianb
Copy link
Collaborator

florianb commented May 2, 2016

Okay, this functionality is implemented by the atom-whitespace-package. Since this is a core-package its functionality has to be treated as first-class-citizen of Atom.

The good message about this is, we're able to easily add support for insert_final_newline, by modifying the text-buffer on the onWillSave-event.

The bad message is, the whitespace-package may override a "negative" setting, since it may be called after our hook.

I'll try to find a solution with the package-maintainer.

@mahnunchik
Copy link

Any news?

@florianb
Copy link
Collaborator

Our feature-request is not supported. It is suggested to work around the issue, which is what we will do. I assume to get this issue into WIP in the next days.

I am sorry for the inconvenience - i was some weeks away from desk and i am still getting back. :)

florianb pushed a commit that referenced this issue Oct 20, 2016
This is the final reorder of the PRs around the next minor release fulfilling containing the following changes:

* Clicking in the statusbar-icon displays a notification, showing the currently applied config and helpful tips if something seems misconfigured (fixes #89)
* Added clickable statusbar-icon to reflect the state of atom-editorconfig for the currently displayed TextBuffer
* Editing `.editorconfig`-files from within Atom now reapplies the settings to all open editors (fixes #85)
* The `trim_trailing_whitespace`-property is now implemented (fixes #3)
* The `insert_final_newline`-property is now implemented (fixes #4)
* The `generate`-command now uses `config.get()` to fetch the defaults for `trim_trailing_whitespace` and `insert_final_newline` (fixes #94)
* The `tab_width`-property now falls back to `indent_size` if missing (fixes #91)

This PR takes the PRs #104 & #102 over.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants