mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Don’t scroll selected item to top in choice menu
We now only ensure it is scrolled into the visible area.
This commit is contained in:
@@ -97,16 +97,12 @@ enum action_t { kActionNop, kActionTab, kActionReturn, kActionCancel, kActionMov
|
||||
choiceIndex = newIndex;
|
||||
if(choiceIndex == NSNotFound)
|
||||
{
|
||||
NSInteger selectedRow = [tableView selectedRow];
|
||||
if(selectedRow != -1)
|
||||
[tableView deselectRow:selectedRow];
|
||||
[tableView deselectAll:self];
|
||||
}
|
||||
else
|
||||
{
|
||||
[tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:choiceIndex] byExtendingSelection:NO];
|
||||
NSRect rowRect = [tableView rectOfRow:choiceIndex];
|
||||
rowRect.size.height = NSHeight([tableView visibleRect]);
|
||||
[tableView scrollRectToVisible:NSIntersectionRect(rowRect, [tableView bounds])];
|
||||
[tableView scrollRectToVisible:[tableView rectOfRow:choiceIndex]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user