diff options
author | stuconnolly <stuart02@gmail.com> | 2012-01-22 12:19:21 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-01-22 12:19:21 +0000 |
commit | 1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f (patch) | |
tree | 6c08ad29618ea02caf302180706d010c90cd57e0 /Source/SPNarrowDownCompletion.m | |
parent | e23ba5155a53c43a106ac9646f51321ccc7d86f4 (diff) | |
download | sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.gz sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.bz2 sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.zip |
Bring outlinew view branch up to date with trunk (r3375:3468).
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 04627e2d..9079954d 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -34,6 +34,7 @@ #import "SPQueryController.h" #import "RegexKitLite.h" #import "SPTextView.h" +#import "SPQueryDocumentsController.h" #pragma mark - #pragma mark attribute definition @@ -827,6 +828,9 @@ } else if((flags & NSAlternateKeyMask) || (flags & NSCommandKeyMask)) { + if (autocompletePlaceholderWasInserted) [self removeAutocompletionPlaceholderUsingFastMethod:YES]; + [theView setCompletionIsOpen:NO]; + [self close]; [NSApp sendEvent:event]; break; } @@ -1002,6 +1006,7 @@ if ([[theView textStorage] attribute:kSPAutoCompletePlaceholderName atIndex:scanPosition longestEffectiveRange:&attributeResultRange inRange:NSMakeRange(scanPosition, currentLength-scanPosition)]) { // A match was found - attributeResultRange contains the range of the attributed string + [theView shouldChangeTextInRange:attributeResultRange replacementString:@""]; [[theView textStorage] deleteCharactersInRange:attributeResultRange]; } else { @@ -1012,6 +1017,7 @@ // A match was found - retrieve the location NSUInteger matchStart = attributeResultRange.location+attributeResultRange.length; if ([[theView textStorage] attribute:kSPAutoCompletePlaceholderName atIndex:matchStart longestEffectiveRange:&attributeResultRange inRange:NSMakeRange(matchStart, currentLength - matchStart)]) { + [theView shouldChangeTextInRange:attributeResultRange replacementString:@""]; [[theView textStorage] deleteCharactersInRange:attributeResultRange]; } } |