diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-08-16 15:15:27 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-08-16 15:15:27 +0000 |
commit | 37e7a952eebd25515bb3ee9d85898a5a984f9d21 (patch) | |
tree | 4a6ba0e364be3b58d2e008444b7579b1083c3fac /Source/SPNarrowDownCompletion.m | |
parent | 31783f3e83e337447a04ccefb4a7d7acdb15083b (diff) | |
download | sequelpro-37e7a952eebd25515bb3ee9d85898a5a984f9d21.tar.gz sequelpro-37e7a952eebd25515bb3ee9d85898a5a984f9d21.tar.bz2 sequelpro-37e7a952eebd25515bb3ee9d85898a5a984f9d21.zip |
• auto-completion in Query Editor now detects whether the caret is inside quotes or not in order to come up with the correct suggestions
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index 508df857..c34bce52 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -612,6 +612,12 @@ if([mutablePrefix length] > 0) { if(dictMode) { + NSPredicate* predicate; + if(caseSensitive) + predicate = [NSPredicate predicateWithFormat:@"match BEGINSWITH %@ OR (match == NULL AND display BEGINSWITH %@)", [self filterString], [self filterString]]; + else + predicate = [NSPredicate predicateWithFormat:@"match BEGINSWITH[c] %@ OR (match == NULL AND display BEGINSWITH[c] %@)", [self filterString], [self filterString]]; + [newFiltered addObjectsFromArray:[suggestions filteredArrayUsingPredicate:predicate]]; for(id w in [[NSSpellChecker sharedSpellChecker] completionsForPartialWordRange:NSMakeRange(0,[[self filterString] length]) inString:[self filterString] language:nil inSpellDocumentWithTag:0]) [newFiltered addObject:[NSDictionary dictionaryWithObjectsAndKeys:w, @"display", nil]]; } else { |