Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Forward text view delegate messages to the syntax coloring controller…

…’s delegate so you can still do delegate-ey things while using syntax coloring.
  • Loading branch information...
commit 4da7c7dbcef8aa2176c1a02ea3cc0fcb57e27ca1 1 parent 2504ceb
@uliwitness authored
View
4 UKSyntaxColoredTextViewController.h
@@ -42,7 +42,7 @@
@class UKSyntaxColoredTextViewController;
-@protocol UKSyntaxColoredTextViewDelegate <NSObject>
+@protocol UKSyntaxColoredTextViewDelegate <NSObject,NSTextViewDelegate>
@optional
-(void) textViewControllerWillStartSyntaxRecoloring: (UKSyntaxColoredTextViewController*)sender; // Show your progress indicator.
@@ -75,7 +75,7 @@
BOOL syntaxColoringBusy; // Set while recolorRange is busy, so we don't recursively call recolorRange.
NSRange affectedCharRange;
NSString* replacementString;
- id<UKSyntaxColoredTextViewDelegate> delegate;
+ IBOutlet id<UKSyntaxColoredTextViewDelegate> delegate;
}
+(void) makeSurePrefsAreInited; // No need to call this.
View
18 UKSyntaxColoredTextViewController.m
@@ -970,6 +970,24 @@ -(NSRange) textView: (NSTextView*)theTextView willChangeSelectionFromCharacterR
}
+-(BOOL) respondsToSelector: (SEL)aSelector
+{
+ if( ![super respondsToSelector: aSelector] )
+ return [self.delegate respondsToSelector: aSelector];
+ else
+ return YES;
+}
+
+
+-(id) forwardingTargetForSelector: (SEL)aSelector
+{
+ id newTarget = [super forwardingTargetForSelector: aSelector];
+ if( newTarget == nil )
+ return self.delegate;
+ return newTarget;
+}
+
+
// -----------------------------------------------------------------------------
// syntaxDefinitionFilename
// Like nibName, this should return the name of the syntax
Please sign in to comment.
Something went wrong with that request. Please try again.