diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-15 15:09:11 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-15 15:09:11 +0000 |
commit | 42a20ff3dd919d89243f6bceb563fb450f74acf2 (patch) | |
tree | e7ec86c603a974cfc5aa56b953467b66433dfb5a /Source | |
parent | 8e840dd2b0e8a5c90e473b0e770dadcef9cb23a1 (diff) | |
download | sequelpro-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')
-rw-r--r-- | Source/CMTextView.m | 4 | ||||
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 31 |
2 files changed, 18 insertions, 17 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m index 6c2bd7a3..c3b27987 100644 --- a/Source/CMTextView.m +++ b/Source/CMTextView.m @@ -450,9 +450,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) if([[self string] length] > parseRange.location+parseRange.length) { if([[self string] characterAtIndex:parseRange.location+parseRange.length] == '`') { backtickMode+=2; - NSLog(@"a %@", NSStringFromRange(parseRange)); parseRange.length++; // adjust parse string for right ` - NSLog(@"b %@", NSStringFromRange(parseRange)); } } @@ -470,6 +468,8 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) } else { filter = [[parsedString stringByReplacingOccurrencesOfString:@"``" withString:@"`"] stringByReplacingOccurrencesOfRegex:@"^`|`$" withString:@""]; } + if(![filter length]) + completionRange = NSMakeRange(parseRange.location+parseRange.length,0); } else { filter = [NSString stringWithString:currentWord]; } 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; } |