Cmd+F Selects old search string

This commit is contained in:
michael starke
2014-02-27 01:53:41 +01:00
parent ffabda0242
commit c1d6574172
2 changed files with 3 additions and 2 deletions

View File

@@ -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];

View File

@@ -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];
}
}