From 39cfd1e8e412572ea53e70f639a8a8031b478ac0 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 5 Jan 2011 19:02:42 +0000 Subject: =?UTF-8?q?=E2=80=A2=20some=20minor=20code=20cleaning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPBundleCommandTextView.m | 8 ++++---- Source/SPTextView.m | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index d467da46..cd6e5706 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -58,13 +58,13 @@ // Re-define tab stops for a better editing [self setTabStops]; - // add NSViewBoundsDidChangeNotification to scrollView - [[commandScrollView contentView] setPostsBoundsChangedNotifications:YES]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boundsDidChangeNotification:) name:@"NSViewBoundsDidChangeNotification" object:[commandScrollView contentView]]; - // disabled to get the current text range in textView safer [[self layoutManager] setBackgroundLayoutEnabled:NO]; + // add NSViewBoundsDidChangeNotification to scrollView + [[commandScrollView contentView] setPostsBoundsChangedNotifications:YES]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boundsDidChangeNotification:) name:NSViewBoundsDidChangeNotification object:[commandScrollView contentView]]; + } - (void)drawRect:(NSRect)rect diff --git a/Source/SPTextView.m b/Source/SPTextView.m index dd582e59..97037e0b 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -144,7 +144,6 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) [self setAutohelp:[prefs boolForKey:SPCustomQueryUpdateAutoHelp]]; [self setAutouppercaseKeywords:[prefs boolForKey:SPCustomQueryAutoUppercaseKeywords]]; [self setCompletionWasReinvokedAutomatically:NO]; - // Re-define tab stops for a better editing [self setTabStops]; @@ -154,8 +153,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) // add NSViewBoundsDidChangeNotification to scrollView [[scrollView contentView] setPostsBoundsChangedNotifications:YES]; - NSNotificationCenter *aNotificationCenter = [NSNotificationCenter defaultCenter]; - [aNotificationCenter addObserver:self selector:@selector(boundsDidChangeNotification:) name:@"NSViewBoundsDidChangeNotification" object:[scrollView contentView]]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boundsDidChangeNotification:) name:NSViewBoundsDidChangeNotification object:[scrollView contentView]]; [self setQueryHiliteColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorHighlightQueryColor]]]; [self setQueryEditorBackgroundColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorBackgroundColor]]]; -- cgit v1.2.3