Permalink
Browse files

Send an initial "selection changed" delegate message.

  • Loading branch information...
1 parent 6dcf91b commit ddb0c122105154b37ca47937df22d283af1e0281 @uliwitness committed Mar 14, 2010
Showing with 6 additions and 4 deletions.
  1. +2 −3 UKSyntaxColoredTextDocument.m
  2. +1 −1 UKSyntaxColoredTextViewController.h
  3. +3 −0 UKSyntaxColoredTextViewController.m
@@ -66,10 +66,11 @@ -(void) windowControllerDidLoadNib: (NSWindowController*)aController
[super windowControllerDidLoadNib: aController];
NSAssert( syntaxColoringController == nil, @"windowControllerDidLoadNib possibly called twice." );
+
syntaxColoringController = [[UKSyntaxColoredTextViewController alloc] init];
[syntaxColoringController setDelegate: self];
[syntaxColoringController setView: textView];
-
+
// Load source code into text view, if necessary:
if( sourceCode != nil )
{
@@ -82,8 +83,6 @@ -(void) windowControllerDidLoadNib: (NSWindowController*)aController
//[progress setStyle: NSProgressIndicatorSpinningStyle]; // NIB forgets that :-(
[progress setDisplayedWhenStopped: NO];
[progress setUsesThreadedAnimation: YES];
-
- [status setStringValue: NSLocalizedString(@"",@"Initial status string in syntax colored text documents.")];
}
@@ -65,7 +65,7 @@
// Class:
// -----------------------------------------------------------------------------
-@interface UKSyntaxColoredTextViewController : NSViewController
+@interface UKSyntaxColoredTextViewController : NSViewController <NSTextViewDelegate>
{
BOOL autoSyntaxColoring; // Automatically refresh syntax coloring when text is changed?
BOOL maintainIndentation; // Keep new lines indented at same depth as their predecessor?
@@ -116,6 +116,9 @@ -(void) setUpSyntaxColoring
// Put selection at top like Project Builder has it, so user sees it:
[TEXTVIEW setSelectedRange: NSMakeRange(0,0)];
+ [self textView: TEXTVIEW willChangeSelectionFromCharacterRange: NSMakeRange(0,0)
+ toCharacterRange: NSMakeRange(0,0)];
+
// Make sure we can use "find" if we're on 10.3:
if( [TEXTVIEW respondsToSelector: @selector(setUsesFindPanel:)] )
[TEXTVIEW setUsesFindPanel: YES];

0 comments on commit ddb0c12

Please sign in to comment.