This PR adds special handling for the first line of a file being deleted. Currently, the git-line-removed class always adds decoration to the bottom of the line number. This works well for everything except when the first line is deleted. In that case, we attempt to decorate row -1, which gets clipped to 0. Then the decorations make it look like we've deleted the second line instead of the first. Now if we need to decorate row -1, we instead add git-previous-line-removed class, which duplicates the existing style except for the positioning of the decoration.
Benefits
Correctly indicates when the first line has been deleted.
Alternate Designs
We could have changed the git-line-removed styling to always apply to always render the decoration at the top and apply the decoration to the next line instead. That was a bigger change and seems like it could have issues at the end of the file instead.
Possible Drawbacks
The duplicated style could maybe be done more elegantly with LESS. @simurai I'll defer to you on that on.
Description of the Change
This PR adds special handling for the first line of a file being deleted. Currently, the
git-line-removed
class always adds decoration to the bottom of the line number. This works well for everything except when the first line is deleted. In that case, we attempt to decorate row-1
, which gets clipped to0
. Then the decorations make it look like we've deleted the second line instead of the first. Now if we need to decorate row-1
, we instead addgit-previous-line-removed
class, which duplicates the existing style except for the positioning of the decoration.Benefits
Correctly indicates when the first line has been deleted.
Alternate Designs
We could have changed the
git-line-removed
styling to always apply to always render the decoration at the top and apply the decoration to the next line instead. That was a bigger change and seems like it could have issues at the end of the file instead.Possible Drawbacks
The duplicated style could maybe be done more elegantly with LESS. @simurai I'll defer to you on that on.
Applicable Issues
Closes #128