0

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?

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Cryptovirus
  • 271
  • 2
  • 6
  • More detailed answers at [Atom text editor remove trailing whitespace on save](https://stackoverflow.com/q/30403150/5358968) – Steve Mar 29 '19 at 14:23

2 Answers2

3

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

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
3

Disable the whitespace package entirely. Worked for me.