Skip to content

Commit

Permalink
Revert "Account for change hunks with additions. #129"
Browse files Browse the repository at this point in the history
This reverts commit 46021d6.
  • Loading branch information
dstein64 committed Mar 20, 2024
1 parent 46021d6 commit 261e10a
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions lua/scrollview/contrib/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,26 +163,14 @@ function M.setup(config)
end
end
elseif hunk.type == 'change' then
-- WARN: A change hunk can be comprised of a change (the removed
-- lines) and an add (lines added after the removed lines). #129
local first = hunk.removed.start
local last = first
local first = hunk.added.start
local last = hunk.added.start
if not config.only_first_line then
last = last + hunk.removed.count - 1
last = last + hunk.added.count - 1
end
for line = first, last do
table.insert(lines_change, line)
end
if hunk.added.count > hunk.removed.count then
first = hunk.removed.start + hunk.removed.count
last = first
if not config.only_first_line then
last = last + hunk.added.count - hunk.removed.count - 1
end
for line = first, last do
table.insert(lines_add, line)
end
end
elseif hunk.type == 'delete' then
table.insert(lines_delete, hunk.added.start)
end
Expand Down

0 comments on commit 261e10a

Please sign in to comment.