Skip to content

Commit

Permalink
fix(signs): make sure signs are always displayed
Browse files Browse the repository at this point in the history
Fixes #614
  • Loading branch information
lewis6991 committed Sep 1, 2022
1 parent f6c9596 commit d7e0bcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lua/gitsigns/manager.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions teal/gitsigns/manager.tl
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ local function apply_win_signs(bufnr: integer, hunks: {Hunk}, top: integer, bot:
-- added but none of them are visible in the window, then make sure to add at
-- least one sign. Only do this on the first call after an update when we all
-- the signs have been cleared.
if clear and hunks[1] then
signs:add(bufnr, gs_hunks.calc_signs(hunks[1], hunks[1].added.start, hunks[1].added.start))
end

for i, hunk in ipairs(hunks or {}) do
if clear and i == 1
or top <= hunk.vend and bot >= hunk.added.start then
for _, hunk in ipairs(hunks or {}) do
if top <= hunk.vend and bot >= hunk.added.start then
signs:add(bufnr, gs_hunks.calc_signs(hunk, top, bot))
end
if hunk.added.start > bot then
Expand Down

0 comments on commit d7e0bcb

Please sign in to comment.