Skip to content
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

Reset item and revert hunk not working with key bindings #286

Closed
mbhall88 opened this issue Sep 22, 2020 · 6 comments · Fixed by #316
Closed

Reset item and revert hunk not working with key bindings #286

mbhall88 opened this issue Sep 22, 2020 · 6 comments · Fixed by #316
Labels
bug Something isn't working

Comments

@mbhall88
Copy link

Describe the bug
Both Reset item ['D'] (stash_drop) and revert hunk ['U'] (status_reset_item) are not working with the vim key bindings. By not working, I mean when I press D on an entry, nothing happens.

To Reproduce
Steps to reproduce the behaviour:

  1. Using this config
  2. Make a change to a file in a git repo
  3. Open gitui
  4. Try and Reset item with D or go to the diff window and try to revert a hunk with U

Expected behavior
The actions work...

Context (please complete the following information):

  • OS/Distro + Version: [e.g. ubuntu 18.04]
  • GitUI Version [e.g. 0.10.1]
  • Rust version: [e.g 1.46.0]
@extrawurst
Copy link
Owner

@yanganto can you look into this?

@extrawurst extrawurst added the bug Something isn't working label Sep 24, 2020
@nerdrew
Copy link

nerdrew commented Oct 1, 2020

It looks like stash_drop's key code is displayed as the shortcut when looking at the Status [1] tab. I set both

    status_reset_item: ( code: Char('!'), modifiers: ( bits: 0,),),
    stash_drop: ( code: Char('!'), modifiers: ( bits: 0,),),

and then I could reset from both the Status [1] tab and from the diff view. Setting bits: 1 made it not work, so maybe it doesn't like if the Char('U') is uppercase and the "shift" modifier is used?

@mbhall88
Copy link
Author

mbhall88 commented Oct 8, 2020

I'm a bit unclear as to whether that was a question/suggestion/comment?

@yanganto
Copy link
Contributor

yanganto commented Oct 8, 2020

@mbhall88 It can work with the following setting if this still not works please kindly pin me. I will try to solve your problem. Thanks.
stash_drop: ( code: Char('D'), modifiers: ( bits: 1,),),

@yanganto
Copy link
Contributor

yanganto commented Oct 8, 2020

I will fix the example later, sorry about this.

@mbhall88
Copy link
Author

mbhall88 commented Oct 10, 2020

The revert hunk with U now works, but stash_drop with D doesn't. (I am using the exact config file you added in #316)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants