diff options
Diffstat (limited to 'Source/CMTextView.h')
-rw-r--r-- | Source/CMTextView.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/CMTextView.h b/Source/CMTextView.h index 374704af..152450b0 100644 --- a/Source/CMTextView.h +++ b/Source/CMTextView.h @@ -32,6 +32,16 @@ #define SP_TEXT_SIZE_TRIGGER_FOR_PARTLY_PARSING 10000 + +static inline void NSMutableAttributedStringAddAttributeValueRange (NSMutableAttributedString* self, NSString* aStr, id aValue, NSRange aRange) { + typedef void (*SPMutableAttributedStringAddAttributeValueRangeMethodPtr)(NSMutableAttributedString*, SEL, NSString*, id, NSRange); + static SPMutableAttributedStringAddAttributeValueRangeMethodPtr SPMutableAttributedStringAddAttributeValueRange; + if (!SPMutableAttributedStringAddAttributeValueRange) SPMutableAttributedStringAddAttributeValueRange = (SPMutableAttributedStringAddAttributeValueRangeMethodPtr)[self methodForSelector:@selector(addAttribute:value:range:)]; + SPMutableAttributedStringAddAttributeValueRange(self, @selector(addAttribute:value:range:), aStr, aValue, aRange); + return; +} + + @interface CMTextView : NSTextView { BOOL autoindentEnabled; BOOL autopairEnabled; |