Fixed: conflict with auto-merge in CPTextView

This commit is contained in:
Alexandre Wilhelm committed 2015-09-30 11:31:32 -07:00
commit 9545e0145f
2 files changed
+15 -17

No files matched your search

+2 -4
View File
@@ -120,22 +120,20 @@ CPKernAttributeName = @"CPKernAttributeName";
{
[self willChangeValueForKey:@"selectable"];
_isSelectable = flag;
[self didChangeValueForKey:@"selectable"];
if (!flag)
[self setEditable:flag];
[self didChangeValueForKey:@"selectable"];
}
- (void)setEditable:(BOOL)flag
{
[self willChangeValueForKey:@"editable"];
_isEditable = flag;
[self didChangeValueForKey:@"editable"];
if (flag)
[self setSelectable:flag];
[self didChangeValueForKey:@"editable"];
}
- (void)changeFont:(id)sender
+13 -13
View File
@@ -270,20 +270,20 @@ var kDelegateRespondsTo_textShouldBeginEditing
_copySelectionGranularity = _previousSelectionGranularity;
[super copy:sender];
if ([self isRichText])
{
var selectedRange = [self selectedRange],
pasteboard = [CPPasteboard generalPasteboard],
stringForPasting = [_textStorage attributedSubstringFromRange:CPMakeRangeCopy(selectedRange)];
if (![self isRichText])
return;
// put rich representation on the pasteboad only if we have multliple attributes selected
if (stringForPasting._rangeEntries.length > 1)
{
var richData = [_CPRTFProducer produceRTF:stringForPasting documentAttributes:@{}];
// [pasteboard declareTypes:[CPStringPboardType, CPRichStringPboardType] owner:nil]; // this does currently do not work due to limitations in cappuccino
[pasteboard setString:richData forType:CPStringPboardType]; // crude hack to make rich pasting possible in chrome and firefox: put rtf on the plain pasteboard
}
}
var selectedRange = [self selectedRange],
pasteboard = [CPPasteboard generalPasteboard],
stringForPasting = [_textStorage attributedSubstringFromRange:CPMakeRangeCopy(selectedRange)];
// put rich representation on the pasteboad only if we have multliple attributes selected
if (stringForPasting._rangeEntries.length > 1)
{
var richData = [_CPRTFProducer produceRTF:stringForPasting documentAttributes:@{}];
// [pasteboard declareTypes:[CPStringPboardType, CPRichStringPboardType] owner:nil]; // this does currently do not work due to limitations in cappuccino
[pasteboard setString:richData forType:CPStringPboardType]; // crude hack to make rich pasting possible in chrome and firefox: put rtf on the plain pasteboard
}
}
- (void)paste:(id)sender