Cryptovirus
Cryptovirus

Reputation: 271

Atom is changing my whitespace against my will - how do I stop it?

Every time I diff a change from a file I've edited, I see things like this change (where a tab has been removed automagically):

I did not do this

Where is the setting to stop this from happening?

Upvotes: 0

Views: 1151

Answers (2)

Kristina Darroch
Kristina Darroch

Reputation: 171

Disable the whitespace package entirely. Worked for me.

Upvotes: 3

Dan Lowe
Dan Lowe

Reputation: 56518

In Atom's settings, go to the Packages section and search for whitespace.

The whitespace package will do the following by default:

  • Remove trailing whitespace at the end of a line
  • Ensure the file contains a trailing newline

You can change the behavior you are seeing in one of two ways.

  1. Uncheck the "Remove Trailing Whitespace" option. That will prevent trailing whitespace from being removed on any line.
  2. Check the "Ignore Whitespace Only Lines" option. If you only care about this behavior when the line is otherwise empty, then this option would serve you better.

For reference: whitespace on atom.io

Upvotes: 3

Related Questions