fixed: missing undo support for textcolor

This commit is contained in:
daboe01
2016-05-24 10:39:23 +02:00
parent f5b177dda8
commit e897d2ef81
+6
View File
@@ -1542,6 +1542,12 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)setTextColor:(CPColor)aColor range:(CPRange)range
{
var currentAttributes = [_textStorage attributesAtIndex:range.location effectiveRange:nil] || _typingAttributes;
[[[[self window] undoManager] prepareWithInvocationTarget:self]
setTextColor:[currentAttributes objectForKey:CPForegroundColorAttributeName]
range:CPMakeRangeCopy(range)];
if (!CPEmptyRange(range))
{
if (aColor)