mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Previously vim-gitgutter generated context-free patches and applied those to the index. However when staging a hunk situated after any deleted lines, the line numbers on the patch were out by the number of lines deleted, and without any context git would apply the patch to the wrong part of the file in the index. This commit ensure patches are generated with 1 line of context, allowing git to adjust the line numbers appropriately and apply the patch to the right location. More lines of context would help git more to adjust line numbers; but the more context we have the more we group together hunks we would like to treat separately.