diff options
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r-- | Source/CMTextView.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m index 4a226ef5..d6a1e9d7 100644 --- a/Source/CMTextView.m +++ b/Source/CMTextView.m @@ -507,7 +507,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) BOOL caretMovedLeft = NO; // Check if caret is located after a ` - if so move caret inside - if([[self string] length] && [[self string] characterAtIndex:caretPos-1] == '`') { + if([[self string] length] && caretPos > 0 && [[self string] characterAtIndex:caretPos-1] == '`') { if([[self string] length] > caretPos && [[self string] characterAtIndex:caretPos] == '`') { ; } else { |