diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-01 23:07:24 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-01 23:07:24 +0000 |
commit | ab560b63b13d9e74e3f1082287dcefe04322cdba (patch) | |
tree | bb0743612c817589a2549ba4efc9e3c4db3f7acf /Source/CMTextView.h | |
parent | 502ccf54c641fcbdda80abf0ed4af243d70e475a (diff) | |
download | sequelpro-ab560b63b13d9e74e3f1082287dcefe04322cdba.tar.gz sequelpro-ab560b63b13d9e74e3f1082287dcefe04322cdba.tar.bz2 sequelpro-ab560b63b13d9e74e3f1082287dcefe04322cdba.zip |
• sped up Query Editor for larger text
- rewrote [NoodleLineNumber requiredThickness] completely to avoid stack overflow for larger text due to [NSMutableString string] plus appendString all the time without releasing it in time
Diffstat (limited to 'Source/CMTextView.h')
-rw-r--r-- | Source/CMTextView.h | 8 |
1 files changed, 8 insertions, 0 deletions
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; |