From ec4d29c327249bfa9b0b8c9eb0d4be6d7b2d82c8 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 2 Oct 2016 10:34:30 +0200 Subject: [PATCH] fixed: transaction issue from the undo manager --- AppKit/CPTextView/CPTextView.j | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 39c4d83d0..73a14b494 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -2039,9 +2039,12 @@ var kDelegateRespondsTo_textShouldBeginEditing [self _deleteForRange:_selectionRange]; [self setSelectedRange:_movingSelection]; - + var dataForPasting = [pasteboard stringForType:CPRTFPboardType]; - [self insertText:[[_CPRTFParser new] parseRTF:dataForPasting]]; + // setTimeout is to a work around a transaction issue with the undomanager + setTimeout(function(){ + [self insertText:[[_CPRTFParser new] parseRTF:dataForPasting]]; + }, 0); } if ([pasteboard availableTypeFromArray:[CPColorDragType]])