Skip to content

Commit 14db8cb

Browse files
authored
Merge pull request laullon#193 from gitx/revert-191-claybridges-no-scroll
Revert "Suppress rescroll when repo is updated externally"
2 parents 093add1 + e2082da commit 14db8cb

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

Classes/Controllers/PBGitHistoryController.m

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,10 @@ - (void) _repositoryUpdatedNotification:(NSNotification *)notification {
180180
- (void)reselectCommitAfterUpdate {
181181
[self updateStatus];
182182

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-
}
183+
if ([self.repository.currentBranch isSimpleRef])
184+
[self selectCommit:[self.repository OIDForRef:self.repository.currentBranch.ref]];
185+
else
186+
[self selectCommit:self.firstCommit.OID];
188187
}
189188

190189
- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row {
@@ -552,11 +551,6 @@ - (NSArray *) selectedObjectsForOID:(GTOID *)commitOID
552551
}
553552

554553
- (void)selectCommit:(GTOID *)commitOID
555-
{
556-
[self selectCommit:commitOID withRescroll:YES];
557-
}
558-
559-
- (void)selectCommit:(GTOID *)commitOID withRescroll:(BOOL)doRescroll
560554
{
561555
if (!forceSelectionUpdate && [[[commitController.selectedObjects lastObject] OID] isEqual:commitOID]) {
562556
return;
@@ -565,10 +559,8 @@ - (void)selectCommit:(GTOID *)commitOID withRescroll:(BOOL)doRescroll
565559
NSArray *selectedObjects = [self selectedObjectsForOID:commitOID];
566560
[commitController setSelectedObjects:selectedObjects];
567561

568-
if (doRescroll) {
569-
NSInteger oldIndex = [[commitController selectionIndexes] firstIndex];
570-
[self scrollSelectionToTopOfViewFrom:oldIndex];
571-
}
562+
NSInteger oldIndex = [[commitController selectionIndexes] firstIndex];
563+
[self scrollSelectionToTopOfViewFrom:oldIndex];
572564

573565
forceSelectionUpdate = NO;
574566
}

0 commit comments

Comments
 (0)