From ce69410f492fa63e73167b5fb0f7cfeb342098ce Mon Sep 17 00:00:00 2001 From: daboe01 Date: Thu, 14 Aug 2014 18:21:53 +0200 Subject: [PATCH] revert of breaking change wrt backspace --- AppKit/CPTextView/CPTextView.j | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index a9bd30a98..9b0a2af3f 100755 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -1211,12 +1211,9 @@ var kDelegateRespondsTo_textShouldBeginEditing else changedRange = _selectionRange; - var isCharacterAtLocationIndex = [self _isCharacterAtIndex:(changedRange.location - 1) granularity:_previousSelectionGranularity], - isCharacterAtMaxIndex = [self _isCharacterAtIndex:CPMaxRange(changedRange) granularity:_previousSelectionGranularity], - stringLength = [[self string] length]; - - if ((_previousSelectionGranularity > 0) && (changedRange.location > 0) && isCharacterAtLocationIndex && - (changedRange.location < stringLength) && isCharacterAtMaxIndex) + if (_previousSelectionGranularity > 0 && + changedRange.location > 0 && [self _isCharacterAtIndex:(changedRange.location - 1) granularity:_previousSelectionGranularity] && + changedRange.location < [[self string] length] && [self _isCharacterAtIndex:CPMaxRange(changedRange) granularity:_previousSelectionGranularity]) { changedRange.length++; }