nav_hunk with opts { target = 'all' } does not handle files with mixed staged and unstaged hunks. If you have 4 hunks staged and 2 hunks unstaged, it will only jump between the first 2 hunks in the file, staged or not.
Neovim version
0.10.1
Operating system and version
Nixos 24.05
Expected behavior
Jump between all 6 hunks, staged or not
Actual behavior
Jumped between first 2 hunks in file, one unstaged and one staged
Minimal config
for name, url in pairs{
gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end
local gs = require("gitsigns")
gs.setup{
debug_mode = true, -- You must add this to enable debug messages
on_attach = function ()
vim.keymap.set('n', ']g', function()
gs.next_hunk({target = 'all'})
end)
vim.keymap.set('n', '[g', function()
gs.prev_hunk({target = 'all'})
end)
end
}
Steps to reproduce
Prereq: setup nvim with above minimal config.
mkdir gitsigns_issue
cd gitsigns_issue
git init
echo "hunk1" >> file
git add file
echo "hunk2" >> file
7 nvim file and observe that ]g and [g don't work between both hunks
Description
nav_hunk with opts { target = 'all' } does not handle files with mixed staged and unstaged hunks. If you have 4 hunks staged and 2 hunks unstaged, it will only jump between the first 2 hunks in the file, staged or not.
Neovim version
0.10.1
Operating system and version
Nixos 24.05
Expected behavior
Jump between all 6 hunks, staged or not
Actual behavior
Jumped between first 2 hunks in file, one unstaged and one staged
Minimal config
Steps to reproduce
Prereq: setup nvim with above minimal config.
mkdir gitsigns_issue
cd gitsigns_issue
git init
echo "hunk1" >> file
git add file
echo "hunk2" >> file
7nvim file
and observe that ]g and [g don't work between both hunksGitsigns debug messages
No response
Gitsigns cache
No response