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

trim_trailing_whitespace property #3

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

trim_trailing_whitespace property #3

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

Comments

@sindresorhus
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link
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 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.
folletto added a commit to folletto/Blipshot that referenced this issue Mar 29, 2017
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 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.

4 participants