diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-06-21 14:39:31 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-06-21 14:39:31 +0000 |
commit | cdf316bb4000fc904a0fac500e506c74db07bebe (patch) | |
tree | ad0abc15a7a767c64f17da49eccc2ea4729c9d93 /Source/CMTextView.h | |
parent | 4c4c5c22a47417eaa458739d1599c7bb24f75053 (diff) | |
download | sequelpro-cdf316bb4000fc904a0fac500e506c74db07bebe.tar.gz sequelpro-cdf316bb4000fc904a0fac500e506c74db07bebe.tar.bz2 sequelpro-cdf316bb4000fc904a0fac500e506c74db07bebe.zip |
• some code cleaning and tiny performance enhancements for syntax highlighting
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; |