aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextView.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r--Source/SPTextView.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 41b5d6e4..cd6e22ff 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -606,7 +606,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSString* filter;
NSString* dbName = nil;
NSString* tableName = nil;
- NSRange completionRange = [self getRangeForCurrentWord];
+ NSRange completionRange = [self getRangeForCurrentWordForCompletion];
NSRange parseRange = completionRange;
NSString* currentWord = [[self string] substringWithRange:completionRange];
NSString* prefix = @"";
@@ -2445,7 +2445,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
&& ![self selectedRange].length
&& [prefs boolForKey:SPCustomQuerySoftIndent]
&& [self isCaretAtIndentPositionIgnoreLineStart:YES]
- && ![self isCaretAdjacentToAlphanumCharWithInsertionOf:'-'])
+ && [self selectedRange].location < [[self string] length] && [[self string] characterAtIndex:[self selectedRange].location] == ' ')
{
[self shiftSelectionLeft];
return;