diff options
-rw-r--r-- | Source/SPTextView.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m index ec54f3a7..e60a28f7 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -644,7 +644,8 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) for(NSUInteger i=0; i<[lineHead length]; i++) if([lineHead characterAtIndex:i]=='`') caretIsInsideBackticks = !caretIsInsideBackticks; - NSCharacterSet *whiteSpaceCharSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; + NSMutableCharacterSet *breakCharSet = [NSMutableCharacterSet characterSetWithCharactersInString:@",;(+=-*/%><~&|^"]; + [breakCharSet formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]]; NSUInteger start = caretPos; NSInteger backticksCounter = (caretIsInsideBackticks) ? 1 : 0; NSInteger pointCounter = 0; @@ -658,7 +659,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) while(start > 0 && doParsing) { currentCharacter = [[self string] characterAtIndex:--start]; - if(!(backticksCounter%2) && ([whiteSpaceCharSet characterIsMember:currentCharacter] || currentCharacter == ',' || currentCharacter == '(')) { + if(!(backticksCounter%2) && [breakCharSet characterIsMember:currentCharacter]) { start++; break; } |