New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`trim_trailing_whitespace` property #3

Closed
sindresorhus opened this Issue Mar 4, 2014 · 3 comments

Comments

4 participants
@sindresorhus
Owner

sindresorhus commented Mar 4, 2014

http://editorconfig.org

trim_trailing_whitespace: set to true to remove any whitespace characters preceding newline characters and false to ensure it doesn't.

The bundled whitespace plugin has an option for this called removeTrailingWhitespace

I can change it with: atom.config.set('whitespace.removeTrailingWhitespace', true);, but that changes it globally and we definitely don't want that. From what I can figure out from the docs it isn't possible to override config on a per buffer basis like you can with Sublime.

@adamloving

This comment has been minimized.

adamloving commented Oct 15, 2014

In other words, Atom bundles a package called "Whitespace" which conflicts with editorconfig and will (by default) remove trailing whitespace even if your .editorconfig file specifies not to remove it (for example with jade files). As a work around, you can open Atom preferences for the Whitespace package and disable the Whitespace package.

@SamVerschueren

This comment has been minimized.

Collaborator

SamVerschueren commented Feb 24, 2016

In the VS Code extension we have to do it manually because there just isn't an option to do this with core methods. Same goes for insert_final_newline.

https://github.com/editorconfig/editorconfig-vscode/tree/master/src/transformations

@florianb

This comment has been minimized.

Collaborator

florianb commented May 2, 2016

As already mentioned, this functionality is implemented by the atom-whitespace-package.

As soon as i have found out how to interact nicely with the whitespace-package, we're going on to implement that functionality.

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

@florianb florianb added this to the Fievel Mousekewitz milestone May 20, 2016

@florianb florianb removed the help wanted label May 20, 2016

@florianb florianb closed this Oct 20, 2016

florianb added a commit that referenced this issue Oct 20, 2016

Fievel Mousekewitz (#106)
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.

folletto added a commit to folletto/Blipshot that referenced this issue Mar 29, 2017

Editorconfig: some cleanup.
I found out that whitespaces are another opinionated thing and of
course "when they can they enforce their own vision", and Atom felt to
enforce to everyone that. Okay overlords. Fine.
sindresorhus/atom-editorconfig#3

And then we wonder why the human race doesn't get along very well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment