Closed d4hines closed 10 months ago
When you're viewing diffs for staged changes you have a representation of what the file looks like in the HEAD
revision on the left, and a representation of what the file looks like in the Git index on the right. Note that these are representations, not real files. Gitsigns won't work in these buffers unless that's explicitly implemented as a feature (I think they do something like that for vim-fugitive buffers).
However, in this plugin we support staging by simply editing the index buffer. This is very powerful because it let's you edit the index the same way you edit any other text. When you :w
the index buffer, the Git index will be updated.
See:
:h diffview-staging
:h copy-diffs
do
to copy the version from the other side of the diff).Closing due to inactivity from OP.
Description
I'd like to unstage a selected hunk from the 'Staged changes' view. I've enabled Git signs for staged changes implemented in this PR so I can see the signs in a normal buffer, and calling
:Gitsigns stage_hunk
correctly unstages a staged hunk.But when I run the same command in the 'Staged changes' view, it has no effect.
Is this something Diffview can support? Or do I need to make a custom function that intelligently maps the selected hunk in the diffview to the correct command? If the latter, any tips on how to do that?
Expected behavior
No response
Actual behavior
:Gitsigns stage_hunk
has no effect.Steps to reproduce
:DiffviewOpen
:Gitsigns stage_hunk
Health check
Output of
``` diffview: require("diffview.health").check() Checking plugin dependencies ~ - OK nvim-web-devicons installed. Checking VCS tools ~ - The plugin requires at least one of the supported VCS tools to be valid. - OK Git found. - OK Git is up-to-date. (2.39.2) - WARNING Configured `hg_cmd` is not executable: 'hg' ```:checkhealth diffview
Log info
No response
Neovim version
Operating system and version
Darwin 22.3.0 arm64
Minimal config
No response