aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNarrowDownCompletion.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-15 15:09:11 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-15 15:09:11 +0000
commit42a20ff3dd919d89243f6bceb563fb450f74acf2 (patch)
treee7ec86c603a974cfc5aa56b953467b66433dfb5a /Source/SPNarrowDownCompletion.m
parent8e840dd2b0e8a5c90e473b0e770dadcef9cb23a1 (diff)
downloadsequelpro-42a20ff3dd919d89243f6bceb563fb450f74acf2.tar.gz
sequelpro-42a20ff3dd919d89243f6bceb563fb450f74acf2.tar.bz2
sequelpro-42a20ff3dd919d89243f6bceb563fb450f74acf2.zip
- removed F5 completion debug output
- fixed issue while ‘normal’ completion after “table.” completion
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r--Source/SPNarrowDownCompletion.m31
1 files changed, 16 insertions, 15 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m
index 16438a56..82564567 100644
--- a/Source/SPNarrowDownCompletion.m
+++ b/Source/SPNarrowDownCompletion.m
@@ -572,25 +572,26 @@
} else {
NSMutableDictionary* selectedItem = [[[filtered objectAtIndex:[theTableView selectedRow]] mutableCopy] autorelease];
NSString* candidateMatch = [selectedItem objectForKey:@"match"] ?: [selectedItem objectForKey:@"display"];
- if([[selectedItem objectForKey:@"path"] length] && [[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask)) {
- NSString *path = [NSString stringWithFormat:@"%@.%@",
- [[[[[selectedItem objectForKey:@"path"] componentsSeparatedByString:@"⇠"] reverseObjectEnumerator] allObjects] componentsJoinedByPeriodAndBacktickQuoted],
- [candidateMatch backtickQuotedString]];
-
- // Check if path's db name is the current selected db name
- NSRange r = [path rangeOfString:[currentDb backtickQuotedString] options:NSCaseInsensitiveSearch range:NSMakeRange(0, [[currentDb backtickQuotedString] length])];
- theCharRange = theParseRange;
- backtickMode = 0; // suppress move the caret one step rightwards
- if(path && [path length] && r.length)
- [self insert_text:[path substringFromIndex:r.length+1]];
- else
- [self insert_text:path];
-
+ if( [[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask)) {
+ if([[selectedItem objectForKey:@"path"] length]) {
+ NSString *path = [NSString stringWithFormat:@"%@.%@",
+ [[[[[selectedItem objectForKey:@"path"] componentsSeparatedByString:@"⇠"] reverseObjectEnumerator] allObjects] componentsJoinedByPeriodAndBacktickQuoted],
+ [candidateMatch backtickQuotedString]];
+
+ // Check if path's db name is the current selected db name
+ NSRange r = [path rangeOfString:[currentDb backtickQuotedString] options:NSCaseInsensitiveSearch range:NSMakeRange(0, [[currentDb backtickQuotedString] length])];
+ theCharRange = theParseRange;
+ backtickMode = 0; // suppress move the caret one step rightwards
+ if(path && [path length] && r.length) {
+ [self insert_text:[path substringFromIndex:r.length+1]];
+ } else {
+ [self insert_text:path];
+ }
+ }
} else {
if([[self filterString] length] < [candidateMatch length])
[self insert_text:candidateMatch];
}
-
}
closeMe = YES;
}