aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPBundleCommandTextView.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-01-27 20:38:23 +0000
committerstuconnolly <stuart02@gmail.com>2011-01-27 20:38:23 +0000
commit8db2f78294982e89fce5a162d92b2be6d9291aa1 (patch)
treeb8dc7736f4af896aa3ed3fa9a96d1f3c4bfd0e59 /Source/SPBundleCommandTextView.m
parentfa7cff57548edc51420693e6909fe2adb3c18951 (diff)
parent7cc062247ff23496dd0390cf07b5d45d6bc49777 (diff)
downloadsequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.tar.gz
sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.tar.bz2
sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.zip
Bring outline view branch up to date with trunk (r3056:r3162).
Diffstat (limited to 'Source/SPBundleCommandTextView.m')
-rw-r--r--Source/SPBundleCommandTextView.m18
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