Skip to content

Commit

Permalink
fix: sort get_nav_hunks to handle mixed hunk states
Browse files Browse the repository at this point in the history
  • Loading branch information
iofq authored and lewis6991 committed Aug 25, 2024
1 parent 562dc47 commit 80214a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/gitsigns/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,9 @@ local function get_nav_hunks(bufnr, target, greedy)
if target == 'all' then
hunks = hunks_main
vim.list_extend(hunks, hunks_head)
table.sort(hunks, function(h1, h2)
return h1.added.start < h2.added.start
end)
elseif target == 'staged' then
hunks = hunks_head
end
Expand Down

0 comments on commit 80214a8

Please sign in to comment.