-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Option to navigate Block sub-menus with same key (1 .. 5) #3789
Comments
Good idea, and shouldn't be hard to do (I think; didn't check yet). There's one problem though: currently, the number keys simply focus the panel but don't go to tab one; they stay in whatever tab is active. This means that you still need to look at the screen to decide how many times you need to press To improve this, we would have to change the number keys so that they jump to the first tab if the panel wasn't already active; that's a breaking change though which might be annoying for some people. (Or maybe not, who knows.) So maybe we'd need a config for that behavior. Keen to hear everybody's opinions. @jesseduffield? |
This is interesting.
But I'm also open to hearing opinions. Arguably the typical user is not changing tabs very often so they wouldn't notice if we reset the tab upon jumping. Pressing the number key is kinda a pro-behaviour anyway; and pros would appreciate the muscle memory optimisation more than regular users. I personally don't use number keys to jump to panels; I just use left/right arrow keys, so I can't really speak from experience. |
Thanks for the response! I would appreciate it to be configurable so I could try it out - but my intuition tells me that I would personally not opt for it to reset to the first tab. This is because I presume it would require a timeout, and I'm not a fan of timeouts because they either surprise me or stress me out, so I always turn them off (on leader keys, for example). If I wasn't sure where I was, and I wanted to guarantee a tab to land on with my eyes closed, I think I'd just do a rolling And thank you for the amazing tool! |
Ah, I wasn't thinking about a timeout, but actually it may be a good solution to the problem. It could go like this:
No configuration needed. It seems this should cover all cases, but shouldn't be surprising or annoying. Or am I missing something? |
Sorry for proposing a timeout, I think I made it more complex unnecessarily. While I'd have a fast way to go to Remotes consistently with I hadn't thoroughly considered what I thought should happen in the case where a sub-panel was already open, so I pulled up lazygit again to feel out what I'd expect the behaviour to be. When pressing N (where N is 1-5):
This seems okay without a timeout, no reset required, and so doesn't feel like a breaking change? The additional feature that was missing that maybe led to the proposal of a reset: I noticed while testing is that the current sub-panel for an inactive panel is not immediately obvious. I couldn't see a color option for it either. I think if I could see that from a glance I'd feel less disoriented when switching panes. Let me know if that's a separate feature request! |
I like that proposal, and for posterity, I do not like the idea of timeouts! |
Here's a draft PR so that we can try how it feels: #3794. |
I like it! Also as you suggested @stefanhaller it was just a terminal color issue - thank you. The part I don't like is that while I'm nested inside into a tab (Remotes -> origin -> HEAD -> commit) and press the current pane's key (2), it currently pops all the way out and moves to the next pane. I think it should either:
|
Interesting, I actually like it this way. And it doesn't actually move to the next tab, but to the first one in that panel; but I happen to like that too, although it's probably unintentional. The same happens when you press For me, the most common use case is that I'm looking at a remote branch to do a code review of a coworker's branch, and when I'm done I press Actually I sometimes have the opposite wish: being taken out of nested views more often. An example is that I'm in panel 4, and go into a commit to look at its files; then I switch to panel 2, and when I come back to 4, I wish it would show me commits again. But that might be annoying in other cases, so I'm not proposing to change that. |
I see. If it's consistent with existing behavior, then I can't argue with that! 👍 |
Fixed by #3794. |
Is your feature request related to a problem? Please describe.
I'm always frustrated when I want to navigate to a sub-panel like Remotes or Worktrees and I have to Press '1-5' followed by ']' some number of times.
Describe the solution you'd like
I'd really like it if I could just hit '2' twice to show Worktrees, or '3' twice to show Remotes. Just cycle through the submenus each time I repeat the key.
Describe alternatives you've considered
I tried checking if it were possible to implement it as a custom command, but I haven't seen any examples of custom commands that operate on lazygit itself (I skimmed the compendium).
The text was updated successfully, but these errors were encountered: