Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github atom editor shows line deleted and added back

Tags:

atom-editor

I am using Github's atom text editor. Most of the times, when I modify a single line in a file, git diff shows a lot of lines as deleted and added back in this way

 -      @op_contact = "Not Available" 
 +      @op_contact = "Not Available"

This causes inconvenience in code-reviews and hence I am forced to use other editors like SublimeText.

It looks like some simple setting should fix this, but I am not sure how to do it and I don't know what to search for. There are some related questions, like this one but I want to fix it from Atom editor, as this problem is not present in SublimeText.

Atom version: 1.3.1

like image 684
Kalyan Raghu Avatar asked Jan 20 '16 10:01

Kalyan Raghu


People also ask

How do you get rid of whitespace in an Atom?

The "Remove Trailing Whitespace" option is on by default. This means that every time you save any file opened in Atom, it will strip all trailing whitespace from the file. If you want to disable this, go to the whitespace package in your settings panel and uncheck that option.

Does Atom work with GitHub?

The GitHub package brings Git and GitHub integration right inside your editor! Now you can switch or create branches, stage changes, commit, pull and push, resolve merge conflicts, view and checkout pull requests and more. Visit the 🚀 documentation to learn how to use all the features.


1 Answers

You are probably searching for the Whitespace package which ships with Atom by default.

It removes unnecessary whitespace at the end of each line. Disable it and your suspicious line changes should be gone.

Atom Whitespace package

like image 182
Zahlex Avatar answered Sep 22 '22 12:09

Zahlex