@@ -180,10 +180,11 @@ - (void) _repositoryUpdatedNotification:(NSNotification *)notification {
180
180
- (void )reselectCommitAfterUpdate {
181
181
[self updateStatus ];
182
182
183
- if ([self .repository.currentBranch isSimpleRef ])
184
- [self selectCommit: [self .repository OIDForRef: self .repository.currentBranch.ref]];
185
- else
186
- [self selectCommit: self .firstCommit.OID];
183
+ if ([self .repository.currentBranch isSimpleRef ]) {
184
+ [self selectCommit: [self .repository OIDForRef: self .repository.currentBranch.ref] withRescroll: NO ];
185
+ } else {
186
+ [self selectCommit: self .firstCommit.OID withRescroll: NO ];
187
+ }
187
188
}
188
189
189
190
- (NSTableRowView *)tableView : (NSTableView *)tableView rowViewForRow : (NSInteger )row {
@@ -551,6 +552,11 @@ - (NSArray *) selectedObjectsForOID:(GTOID *)commitOID
551
552
}
552
553
553
554
- (void )selectCommit : (GTOID *)commitOID
555
+ {
556
+ [self selectCommit: commitOID withRescroll: YES ];
557
+ }
558
+
559
+ - (void )selectCommit : (GTOID *)commitOID withRescroll : (BOOL )doRescroll
554
560
{
555
561
if (!forceSelectionUpdate && [[[commitController.selectedObjects lastObject ] OID ] isEqual: commitOID]) {
556
562
return ;
@@ -559,8 +565,10 @@ - (void)selectCommit:(GTOID *)commitOID
559
565
NSArray *selectedObjects = [self selectedObjectsForOID: commitOID];
560
566
[commitController setSelectedObjects: selectedObjects];
561
567
562
- NSInteger oldIndex = [[commitController selectionIndexes ] firstIndex ];
563
- [self scrollSelectionToTopOfViewFrom: oldIndex];
568
+ if (doRescroll) {
569
+ NSInteger oldIndex = [[commitController selectionIndexes ] firstIndex ];
570
+ [self scrollSelectionToTopOfViewFrom: oldIndex];
571
+ }
564
572
565
573
forceSelectionUpdate = NO ;
566
574
}
0 commit comments