From c1d65741727609663943d0cea1c8773d0b49750c Mon Sep 17 00:00:00 2001 From: michael starke Date: Thu, 27 Feb 2014 01:53:41 +0100 Subject: [PATCH] Cmd+F Selects old search string --- MacPass/MPEntryViewController.m | 2 +- MacPass/MPToolbarDelegate.m | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index ba9121ea..c3c20536 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -314,7 +314,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; if(document.selectedItem == document.selectedGroup) { /* If we change to a group selection, we should clear the filter */ if(_isDisplayingContextBar) { - [document exitSearch:self]; + // nothing? } else if([[self.entryArrayController content] count] > 0) { KPKEntry *entry = [[self.entryArrayController content] lastObject]; diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 45d4735b..b5979ece 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -225,13 +225,14 @@ NSString *const MPToolbarItemSearch = @"TOOLBAR_SEARCH"; - (void)_didEnterSearch:(NSNotification *)notification { [[self.searchField window] makeFirstResponder:self.searchField]; + [self.searchField selectText:self]; } - (void)_didExitSearch:(NSNotification *)notification { [self.searchField setStringValue:@""]; NSWindow *window = [self.searchField window]; /* Resign first responder form search field only if it was the first responder */ - if([window firstResponder] == self.searchField ) { + if([window firstResponder] == [self.searchField currentEditor]) { [window makeFirstResponder:nil]; } }