File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ NS_ASSUME_NONNULL_BEGIN
60
60
// Find/Search methods
61
61
- (IBAction )selectNext : (id )sender ;
62
62
- (IBAction )selectPrevious : (id )sender ;
63
+ - (IBAction )selectParentCommit : (id )sender ;
63
64
64
65
- (IBAction )copy : (id )sender ;
65
66
- (IBAction )copySHA : (id )sender ;
Original file line number Diff line number Diff line change @@ -448,6 +448,21 @@ - (IBAction)selectPrevious:(id)sender
448
448
[searchController selectPreviousResult ];
449
449
}
450
450
451
+ - (IBAction ) selectParentCommit : (id )sender
452
+ {
453
+ NSArray *selectedObjects = commitController.selectedObjects ;
454
+ if (selectedObjects.count != 1 ) return ;
455
+
456
+ PBGitCommit *selectedCommit = selectedObjects[0 ];
457
+
458
+ NSArray <GTOID *> *parents = selectedCommit.parents ;
459
+ /* TODO: This is a merge commit. It would be nice to choose the parent with
460
+ * the most commits, but for now we will use whatever commit is our first parent.
461
+ */
462
+
463
+ [self selectCommit: parents[0 ]];
464
+ }
465
+
451
466
- (IBAction ) copy : (id )sender
452
467
{
453
468
[GitXCommitCopier putStringToPasteboard: [GitXCommitCopier toSHAAndHeadingString: commitController.selectedObjects]];
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ - (void)keyDown:(NSEvent *)event
43
43
}
44
44
else if ([character rangeOfCharacterFromSet: [NSCharacterSet characterSetWithCharactersInString: @" jkcv" ]].location == 0 )
45
45
[webController sendKey: character];
46
- else
46
+ else if (([character characterAtIndex: 0 ] == NSDownArrowFunctionKey)
47
+ && [event modifierFlags ] & NSControlKeyMask ) {
48
+ [controller selectParentCommit: self ];
49
+ } else
47
50
[super keyDown: event];
48
51
}
49
52
You can’t perform that action at this time.
0 commit comments