Find in Folder: ⌘1-n selects first match

Previously we would select the n’th file in the result list so one would have to then use arrow down to get to the first match of this file. Now we go directly to the first match in the file (unless the matches for the item is collapsed).
This commit is contained in:
Allan Odgaard
2012-08-18 01:37:16 +02:00
parent c7f267cd12
commit d5d79d6c0c

View File

@@ -329,7 +329,8 @@ struct operation_t
if([match.path isEqualToString:path])
{
NSUInteger row = [findAllResultsOutlineView rowForItem:match];
[findAllResultsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
NSUInteger firstMatch = row + ([findAllResultsOutlineView isItemExpanded:match] ? 1 : 0);
[findAllResultsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:firstMatch] byExtendingSelection:NO];
[[findAllResultsOutlineView window] makeFirstResponder:findAllResultsOutlineView];
[findAllResultsOutlineView scrollRowToVisible:findAllResultsOutlineView.numberOfRows-1];
[findAllResultsOutlineView scrollRowToVisible:row];