fixed ^a and ^e semantics

This commit is contained in:
daboe01
2016-09-16 18:32:14 +02:00
parent dd4e044608
commit 422e014eff
+11 -2
View File
@@ -1170,8 +1170,14 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)moveToEndOfParagraph:(id)sender
{
if ([self isSelectable])
if (![self isSelectable])
return;
if (!_isNewlineCharacter([[_textStorage string] characterAtIndex:_selectionRange.location]))
[self _moveSelectionIntoDirection:1 granularity:CPSelectByParagraph];
if (_isNewlineCharacter([[_textStorage string] characterAtIndex:MAX(0, _selectionRange.location - 1)]))
[self moveLeft:sender];
}
- (void)moveToEndOfParagraphAndModifySelection:(id)sender
@@ -1244,7 +1250,10 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)moveToBeginningOfParagraph:(id)sender
{
if ([self isSelectable])
if (![self isSelectable])
return;
if (!_isNewlineCharacter([[_textStorage string] characterAtIndex:MAX(0, _selectionRange.location - 1)]))
[self _moveSelectionIntoDirection:-1 granularity:CPSelectByParagraph];
}