atom/git-diff

When deleting first line in file, diff shows that second line is deleted

bjubes opened this issue · 4 comments

Prerequisites

Description

After editing a file inside a git repo and deleting the top line of a file, the deletion icon in between the line numbers is in between lines 1 and 2 instead of at the top. I assuming this is an oversight, not an intentional design decision.

capture

Steps to Reproduce

  1. Open a git repo in atom
  2. delete the top line

Expected behavior:
to see the the indicator before the first line

Actual behavior:
the indicator is between first and second line

Reproduces how often: 100%

Versions

Atom : 1.14.4
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0
Windows 10 v1607

Additional Information

diff:

index 7c43f5c..7509ebf 100644
--- a/main.js
+++ b/main.js
@@ -1,4 +1,3 @@
-//app.js
 var express = require('express');
 var app = express();
 var serv = require('http').Server(app);

Came here to report exactly this. No updates huh? 😄

rsese commented

Yeah that's correct, no updates - the team hasn't been able to get to it with all the work on their plate. If there was a well-written community pull request, I could ask the team to take a look though I still couldn't make any promises about it.

@simurai, could you help out with this one? If I added a special class to the line number in addition to or instead of .git-line-removed such as .git-line-previous-removed would you be able to craft some CSS to add the decorations to the top of the line number instead of the bottom as is currently happening? Or do you have any other suggestions?

@simurai I went ahead and opened a PR following that approach. Maybe you can give it a look?