diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-19 16:21:10 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-19 16:21:10 +0000 |
commit | 8a7621ee68c7de9a08bbd1552c6006e4fa3aaaa9 (patch) | |
tree | 469e94974d25ebbccb1d174d2fb921e063809be9 /Source/SPNarrowDownCompletion.m | |
parent | e1e725ef1c285f28cbbb6f4b4e8ef86b011aa34e (diff) | |
download | sequelpro-8a7621ee68c7de9a08bbd1552c6006e4fa3aaaa9.tar.gz sequelpro-8a7621ee68c7de9a08bbd1552c6006e4fa3aaaa9.tar.bz2 sequelpro-8a7621ee68c7de9a08bbd1552c6006e4fa3aaaa9.zip |
• further work on Navigator (not yet active but workable -> unHide menu item)
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index cfdd7605..de9d39aa 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -346,8 +346,11 @@ if([[filtered objectAtIndex:rowIndex] objectForKey:@"path"]) { NSMutableString *tt = [NSMutableString string]; [tt setString:NSLocalizedString(@"Schema path:", @"schema path header for completion tooltip")]; - for(id p in [[[[[filtered objectAtIndex:rowIndex] objectForKey:@"path"] componentsSeparatedByString:@"⇠"] reverseObjectEnumerator] allObjects]) - [tt appendFormat:@"\n• %@",p]; + BOOL flag = NO; + for(id p in [[[filtered objectAtIndex:rowIndex] objectForKey:@"path"] componentsSeparatedByString:SPUniqueSchemaDelimiter]) { + if(flag) [tt appendFormat:@"\n• %@",p]; + flag=YES; + } return tt; } return @""; @@ -426,8 +429,9 @@ [b setAltersStateOfSelectedItem:NO]; [b setControlSize:NSMiniControlSize]; NSMenu *m = [[NSMenu alloc] init]; - for(id p in [[[filtered objectAtIndex:rowIndex] objectForKey:@"path"] componentsSeparatedByString:@"⇠"]) + for(id p in [[[[[filtered objectAtIndex:rowIndex] objectForKey:@"path"] componentsSeparatedByString:SPUniqueSchemaDelimiter] reverseObjectEnumerator] allObjects]) [m addItemWithTitle:p action:NULL keyEquivalent:@""]; + [m removeItemAtIndex:[m numberOfItems]-1]; [b setMenu:m]; [m release]; [b setPreferredEdge:NSMinXEdge]; @@ -486,7 +490,9 @@ for(i=0; i<[[self filterString] length]; i++) { c = [[self filterString] characterAtIndex:i]; if(c != '`') { - if(c == '.' || c == '(' || c == ')' || c == '[' || c == ']' || c == '{' || c == '}') + if(c == '.') + [fuzzyRegexp appendString:[NSString stringWithFormat:@".*?",SPUniqueSchemaDelimiter]]; + else if (c == '(' || c == ')' || c == '[' || c == ']' || c == '{' || c == '}') [fuzzyRegexp appendString:[NSString stringWithFormat:@".*?\\%c",c]]; else [fuzzyRegexp appendString:[NSString stringWithFormat:@".*?%c",c]]; @@ -494,7 +500,7 @@ } for(id s in suggestions) - if([[s objectForKey:@"display"] isMatchedByRegex:fuzzyRegexp] || [[s objectForKey:@"isRef"] isMatchedByRegex:fuzzyRegexp]) + if([[s objectForKey:@"display"] isMatchedByRegex:fuzzyRegexp] || [[s objectForKey:@"path"] isMatchedByRegex:fuzzyRegexp]) [newFiltered addObject:s]; @@ -799,7 +805,7 @@ && ([[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask)) && [[selectedItem objectForKey:@"path"] length]) { NSString *path = [NSString stringWithFormat:@"%@.%@", - [[[[[selectedItem objectForKey:@"path"] componentsSeparatedByString:@"⇠"] reverseObjectEnumerator] allObjects] componentsJoinedByPeriodAndBacktickQuoted], + [[[selectedItem objectForKey:@"path"] componentsSeparatedByString:SPUniqueSchemaDelimiter] componentsJoinedByPeriodAndBacktickQuotedAndIgnoreFirst], [candidateMatch backtickQuotedString]]; // Check if path's db name is the current selected db name |