mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 17:12:50 +00:00
fix range exception when smart-cutting last word
This commit is contained in:
1 parent
49c7e7ce2d
commit
18d83b8c50
1 file changed
+2
@@ -1228,6 +1228,8 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
if (![self shouldChangeTextInRange:changedRange replacementString:@""])
|
||||
return;
|
||||
|
||||
changedRange = CPIntersectionRange(CPMakeRange(0, [_layoutManager numberOfCharacters]), changedRange);
|
||||
|
||||
[[[[self window] undoManager] prepareWithInvocationTarget:self] _replaceCharactersInRange:CPMakeRange(_selectionRange.location, 0) withAttributedString:[_textStorage attributedSubstringFromRange:CPMakeRangeCopy(changedRange)]];
|
||||
[_textStorage deleteCharactersInRange:CPMakeRangeCopy(changedRange)];
|
||||
|
||||
|
||||
Reference in new issue
Block a user