When partially staging a hunk (e.g: only staging the middle line of a 5-line hunk), the whole hunk's sign changes to the "staged" (dimmer) sign.
The unstaged lines should keep their "unstaged" sign, and the staged one the "staged" sign.
A similar problem that I've noticed is when staging a hunk, then modifying it (e.g: staging a 5-line hunk, then adding a line in the middle).
I remember this not being an issue in a previous version of gitsigns.nvim (haven't tried bisecting it yet).
Neovim version
0.10.0
Operating system and version
NixOS unstable
Expected behavior
No response
Actual behavior
Only the middle line (3) has been staged in the following screenshot:
It looks like the whole hunk has been staged.
I would expect to instead have 2 "unstaged" (bright green), one "staged" (dull green), and two "unstaged".
Minimal config
for name, url in pairs{
gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} 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
require('gitsigns').setup{
debug_mode = true, -- You must add this to enable debug messages
-- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}
-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
Description
When partially staging a hunk (e.g: only staging the middle line of a 5-line hunk), the whole hunk's sign changes to the "staged" (dimmer) sign.
The unstaged lines should keep their "unstaged" sign, and the staged one the "staged" sign.
A similar problem that I've noticed is when staging a hunk, then modifying it (e.g: staging a 5-line hunk, then adding a line in the middle).
I remember this not being an issue in a previous version of
gitsigns.nvim
(haven't tried bisecting it yet).Neovim version
0.10.0
Operating system and version
NixOS unstable
Expected behavior
No response
Actual behavior
Only the middle line (
3
) has been staged in the following screenshot:It looks like the whole hunk has been staged.
I would expect to instead have 2 "unstaged" (bright green), one "staged" (dull green), and two "unstaged".
Minimal config
Steps to reproduce
git init test
cd test
echo '3' > test
git add test
printf "1\n2\n3\n4\n5\n" > test
nvim test
Gitsigns debug messages
No response
Gitsigns cache
No response