aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNarrowDownCompletion.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-10 12:54:30 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-10 12:54:30 +0000
commitf8f8a867b96a5559a136bfa3e671788e6fd4a31c (patch)
tree7b7ac2571c9ff36a63414650ce9293b276ba57a9 /Source/SPNarrowDownCompletion.m
parentca4c4bc3b86ff98bbb4e5ca57a16b0066add02aa (diff)
downloadsequelpro-f8f8a867b96a5559a136bfa3e671788e6fd4a31c.tar.gz
sequelpro-f8f8a867b96a5559a136bfa3e671788e6fd4a31c.tar.bz2
sequelpro-f8f8a867b96a5559a136bfa3e671788e6fd4a31c.zip
• auto-completion
- suppress completion window if only one item is found and the typed word is equal to it (case-insensitively) - fixed memory leak
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r--Source/SPNarrowDownCompletion.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m
index a17c3aac..42660be1 100644
--- a/Source/SPNarrowDownCompletion.m
+++ b/Source/SPNarrowDownCompletion.m
@@ -525,6 +525,7 @@
if(![newFiltered count]) {
if(autoCompletionMode) {
+ [newFiltered release];
closeMe = YES;
return;
} else {
@@ -532,6 +533,7 @@
if([[self filterString] hasSuffix:@"."]) {
[theView setCompletionWasReinvokedAutomatically:YES];
[theView doCompletionByUsingSpellChecker:dictMode fuzzyMode:fuzzyMode autoCompleteMode:NO];
+ [newFiltered release];
closeMe = YES;
return;
} else {
@@ -539,6 +541,11 @@
}
}
}
+ if(autoCompletionMode && [newFiltered count] == 1 && [[[self filterString] lowercaseString] isEqualToString:[[[newFiltered objectAtIndex:0] objectForKey:@"display"] lowercaseString]]) {
+ [newFiltered release];
+ closeMe = YES;
+ return;
+ }
NSPoint old = NSMakePoint([self frame].origin.x, [self frame].origin.y + [self frame].size.height);