Skip to content

focus_below binding works inconsistently #1539

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

Closed
strogonoff opened this issue Feb 9, 2023 · 4 comments · Fixed by #1540
Closed

focus_below binding works inconsistently #1539

strogonoff opened this issue Feb 9, 2023 · 4 comments · Fixed by #1540
Labels
bug Something isn't working
Milestone

Comments

@strogonoff
Copy link

strogonoff commented Feb 9, 2023

Describe the bug

Key assigned to focus_below works correctly on commit details screen, but on status screen it does not have desired effect (which would presumably be “focus the staging pane, if current focus is in unstaged changes pane”).

Same happens with focus_above, however focus_left or focus_right work correctly.

To Reproduce

My key configuration is this (but I found it works with any bindings):

focus_right: Some(( code: Char('l'), modifiers: ( bits: 2,),)),
focus_left: Some(( code: Char('h'), modifiers: ( bits: 2,),)),
focus_above: Some(( code: Char('k'), modifiers: ( bits: 2,),)),
focus_below: Some(( code: Char('j'), modifiers: ( bits: 2,),)),
  1. Open gitui (defaults to status screen, focusing unstaged change list)
  2. Hit ctrl+j
  3. Nothing happens

Expected behavior

  1. Takes focus to staging area

Screenshots

Context (please complete the following information):

  • Terminal: Alacritty
  • OS/Distro + Version: macOS 13.2
  • GitUI Version 0.22.1
  • Rust version: rustc 1.67.0 fc594f156

Additional context

@strogonoff strogonoff added the bug Something isn't working label Feb 9, 2023
@extrawurst
Copy link
Collaborator

try

    move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
    move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
    move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
    move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),

see here: https://github.com/extrawurst/gitui/blob/master/KEY_CONFIG.md

anyway I think this brings up a good point, why do we have both sets move_... and focus_... so I am using this ticket to consolidate them into one set. will most likely be bound to the same keys anyway

@strogonoff
Copy link
Author

You are suggesting me to unset the modifier bit, which is the entire point of my modification to the snippet linked from README.

anyway I think this brings up a good point, why do we have both sets move_... and focus_... so I am using this ticket to consolidate them into one set. will most likely be bound to the same keys anyway

The difference is obvious to me: I don’t want to scroll through 24 changed filed in order to jump to lower pane. I assume move_* moves one item and focus_* focuses the pane—which works except for top/down pane movements.

@extrawurst
Copy link
Collaborator

The difference is obvious to me: I don’t want to scroll through 24 changed filed in order to jump to lower pane

this is not how it worked before anyway. there is a specific toggle for toggling between focusing workarea and staging that is called toggle_workarea (defaults to w).

for using the control bit 2: it works in my iterm2 on Mac. so its probably your terminal eating that code before it arrives in gitui

@strogonoff
Copy link
Author

strogonoff commented Feb 13, 2023

this is not how it worked before anyway. there is a specific toggle for toggling between focusing workarea and staging that is called toggle_workarea (defaults to w).

Doh!! Thanks for the pointer!

for using the control bit 2: it works in my iterm2 on Mac. so its probably your terminal eating that code before it arrives in gitui

But the control bit works for me too! Just not for focus up/down (only for left/right). That’s the inconsistency I wanted to report originally. Of course it increasingly looks like I actually don’t get how it’s supposed to work ;)

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.

2 participants