vim-gitgutter
vim-gitgutter copied to clipboard
Staging from hunk preview can stage change into wrong file
- Open two different files.
- Change the first file and preview the change.
- Go to second window and then to hunk preview.
- Stage the hunk.
- Expected: change is staged into first file. Actual: change is staged into second file.
This is because the code uses wincmd p
to return to the parent window when staging from a preview.
Solution: store the parent window in a buffer variable in the hunk preview and use that when returning to the original window.