New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle stage hunk #788
Comments
Great idea! I would change it a bit to a line_toggle_staged, not whole hunk |
It's gonna be tricky to implement. Git doesn't keep track of hunks staged. It's a pile fo staged hunks for a given file only. |
Gitsigns can already track staged hunks if you set |
@lewis6991 Is there any particular reason for this option to not be documented? |
Because it isn't finished. |
Fair enough! |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When I accidentally stage the hunk my cursor is under, it's frustrating that I can't use the same keybind / command to toggle the staged status of the hunk. I know that
undo_stage
exists, but it's on a separate keybind, and I couldn't find a way to make a custom mapping which performs one of the actions based on whether the current hunk is staged or not.Describe the solution you'd like
A clear and concise description of what you want to happen.
A
hunk_toggle_staged
action which stages the hunk under the cursor if unstaged, and vice versa.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Registering a custom command; using the cmdline to find out whether the current line is staged.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: