mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-07 03:07:12 +00:00
redo support added
This commit is contained in:
@@ -429,6 +429,10 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
|
||||
- (void)_replaceCharactersInRange:aRange withAttributedString:(CPString)aString
|
||||
{
|
||||
[[[[self window] undoManager] prepareWithInvocationTarget:self]
|
||||
_replaceCharactersInRange:CPMakeRange(aRange.location, [aString length])
|
||||
withAttributedString:[_textStorage attributedSubstringFromRange:CPMakeRangeCopy(aRange)]];
|
||||
|
||||
[_textStorage replaceCharactersInRange:aRange withAttributedString:aString];
|
||||
[self setSelectedRange:CPMakeRange(aRange.location, [aString length])];
|
||||
[_layoutManager _validateLayoutAndGlyphs];
|
||||
@@ -439,6 +443,10 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
}
|
||||
- (void)_replaceCharactersInRange:(CPRange)aRange withString:(CPString)aString
|
||||
{
|
||||
[[[[self window] undoManager] prepareWithInvocationTarget:self]
|
||||
_replaceCharactersInRange:CPMakeRange(aRange.location, [aString length])
|
||||
withString:[[self string] substringWithRange:CPMakeRangeCopy(aRange)]];
|
||||
|
||||
[_textStorage replaceCharactersInRange:CPMakeRangeCopy(aRange) withString:aString];
|
||||
[self setSelectedRange:CPMakeRange(aRange.location, aString.length)];
|
||||
[_layoutManager _validateLayoutAndGlyphs];
|
||||
|
||||
Reference in New Issue
Block a user