From 98a57829abc6566e4f61cbba33599c5b7d078974 Mon Sep 17 00:00:00 2001 From: yyfrankyy Date: Thu, 15 Mar 2012 11:15:47 +0800 Subject: [PATCH] fix #6 --- EGOTextView/EGOTextView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EGOTextView/EGOTextView.m b/EGOTextView/EGOTextView.m index cb5b4ef..e4d70bb 100644 --- a/EGOTextView/EGOTextView.m +++ b/EGOTextView/EGOTextView.m @@ -1156,7 +1156,7 @@ - (void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRang selectedNSRange = NSMakeRange(selectedRange.location + markedTextRange.location, selectedRange.length); - self.attributedString = _attributedString; + self.attributedString = markedText.length == 0 ? _attributedString : _mutableAttributedString; self.markedRange = markedTextRange; self.selectedRange = selectedNSRange;