From d5d79d6c0c74e42187d23c00a80431b35ce181b7 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Sat, 18 Aug 2012 01:37:16 +0200 Subject: [PATCH] =?UTF-8?q?Find=20in=20Folder:=20=E2=8C=981-n=20selects=20?= =?UTF-8?q?first=20match?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- Frameworks/Find/src/FFWindowController.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Frameworks/Find/src/FFWindowController.mm b/Frameworks/Find/src/FFWindowController.mm index dc72122a..23540b21 100644 --- a/Frameworks/Find/src/FFWindowController.mm +++ b/Frameworks/Find/src/FFWindowController.mm @@ -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];