diff options
Diffstat (limited to 'Source/SPBundleCommandTextView.m')
-rw-r--r-- | Source/SPBundleCommandTextView.m | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index 6411ccfd..d9aae0f7 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -31,8 +31,8 @@ - (void)dealloc { - [prefs removeObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth]; [[NSNotificationCenter defaultCenter] removeObserver:self]; + [prefs removeObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth]; [prefs release]; [lineNumberView release]; } @@ -58,12 +58,13 @@ // Re-define tab stops for a better editing [self setTabStops]; - // add NSViewBoundsDidChangeNotification to scrollView - [[commandScrollView contentView] setPostsBoundsChangedNotifications:YES]; - // disabled to get the current text range in textView safer [[self layoutManager] setBackgroundLayoutEnabled:NO]; + // add NSViewBoundsDidChangeNotification to scrollView + [commandScrollView setPostsBoundsChangedNotifications:YES]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boundsDidChangeNotification:) name:NSViewBoundsDidChangeNotification object:[commandScrollView contentView]]; + } - (void)drawRect:(NSRect)rect @@ -781,6 +782,15 @@ textWasChanged = YES; } +/** + * Scrollview delegate after the command textView's view port was changed. + * Manily used to render line numbering. + */ +- (void)boundsDidChangeNotification:(NSNotification *)notification +{ + [commandScrollView display]; +} + #pragma mark - // Store the font in the prefs for selected delegates only |