diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 01f5e6765..5ae5d721b 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -5235,12 +5235,13 @@ Your delegate can implement this method to avoid subclassing the tableview to ad if (_implementedDelegateMethods & CPTableViewDelegate_tableView_shouldSelectRow_) { + var shouldSelect = [_delegate tableView:self shouldSelectRow:i]; - while (![_delegate tableView:self shouldSelectRow:i] && (i < [self numberOfRows] && i > 0)) + while (!shouldSelect && (i < [self numberOfRows] && i > 0)) shouldGoUpward ? i-- : i++; //check to see if the row can be selected if it can't be then see if the next row can be selected // If the index still can be selected after the loop then just return. - if (![_delegate tableView:self shouldSelectRow:i]) + if (!shouldSelect) return; }