-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add key navigation between index and workdir files #921
Add key navigation between index and workdir files #921
Conversation
Navigate to index files controller when Down button pressed while on the last file of the workdir list Navigate to workdir files controller when Up button pressed while on the first files of the index list
Would like to discuss a possibility to add arrow navigation between individual lines in the diff view. |
Thanks for writing this up. I'll take some time tonight or tomorrow to review what's being changed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay in reviewing this. Looks good to me and welcome functionality.
Small nits just to change the type to match the modifierFlags
property.
I was also thinking if there was an easier way to just say there were no modifiers, but I guess it includes caps lock and things like that, so this looks appropriate.
Other than that, it's ready to merge.
GitUpKit/Interface/GIConstants.h
Outdated
@@ -29,3 +30,5 @@ typedef NS_ENUM(unsigned short, GIKeyCode) { | |||
kGIKeyCode_Return = 0x24, | |||
kGIKeyCode_Delete = 0x33 | |||
}; | |||
|
|||
static const long kGIKeyModifiersAll = NSEventModifierFlagShift | NSEventModifierFlagControl | NSEventModifierFlagCommand | NSEventModifierFlagOption; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static const long kGIKeyModifiersAll = NSEventModifierFlagShift | NSEventModifierFlagControl | NSEventModifierFlagCommand | NSEventModifierFlagOption; | |
static const NSEventModifierFlags kGIKeyModifiersAll = NSEventModifierFlagShift | NSEventModifierFlagControl | NSEventModifierFlagCommand | NSEventModifierFlagOption; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Use more precise type for long flags
Navigate to index files controller when Down button pressed while on the last file of the workdir list
Navigate to workdir files controller when Up button pressed while on the first files of the index list
Context: I'm using keyboard navigation for most of the actions in GitUp but there were no way to quickly navigate b/w staged and un-staged files, and while it's possible with Tab/Shift+Tab it breaks natural up/down navigation that's available in simple mode. This change adds that ability to standard mode as well.
Testing and considerations:
Arrow up & Arrow down to select a different file
which is still true