From ab560b63b13d9e74e3f1082287dcefe04322cdba Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 1 Feb 2010 23:07:24 +0000 Subject: =?UTF-8?q?=E2=80=A2=20sped=20up=20Query=20Editor=20for=20larger?= =?UTF-8?q?=20text=20-=20rewrote=20[NoodleLineNumber=20requiredThickness]?= =?UTF-8?q?=20completely=20to=20avoid=20stack=20overflow=20for=20larger=20?= =?UTF-8?q?text=20due=20to=20[NSMutableString=20string]=20plus=20appendStr?= =?UTF-8?q?ing=20all=20the=20time=20without=20releasing=20it=20in=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CMTextView.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/CMTextView.h') diff --git a/Source/CMTextView.h b/Source/CMTextView.h index ea0b36cc..a7c0ccea 100644 --- a/Source/CMTextView.h +++ b/Source/CMTextView.h @@ -38,6 +38,13 @@ static inline void NSMutableAttributedStringAddAttributeValueRange (NSMutableAtt SPMutableAttributedStringAddAttributeValueRange(self, @selector(addAttribute:value:range:), aStr, aValue, aRange); return; } +static inline id NSMutableAttributedStringAttributeAtIndex (NSMutableAttributedString* self, NSString* aStr, NSUInteger index, NSRangePointer range) { + typedef id (*SPMutableAttributedStringAttributeAtIndexMethodPtr)(NSMutableAttributedString*, SEL, NSString*, NSUInteger, NSRangePointer); + static SPMutableAttributedStringAttributeAtIndexMethodPtr SPMutableAttributedStringAttributeAtIndex; + if (!SPMutableAttributedStringAttributeAtIndex) SPMutableAttributedStringAttributeAtIndex = (SPMutableAttributedStringAttributeAtIndexMethodPtr)[self methodForSelector:@selector(attribute:atIndex:effectiveRange:)]; + id r = SPMutableAttributedStringAttributeAtIndex(self, @selector(attribute:atIndex:effectiveRange:), aStr, index, range); + return r; +} @interface CMTextView : NSTextView { BOOL autoindentEnabled; @@ -49,6 +56,7 @@ static inline void NSMutableAttributedStringAddAttributeValueRange (NSMutableAtt NoodleLineNumberView *lineNumberView; BOOL startListeningToBoundChanges; + BOOL textBufferSizeIncreased; NSString *showMySQLHelpFor; -- cgit v1.2.3