aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPWindow.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-08-31 01:23:29 +0000
committerrowanbeentje <rowan@beent.je>2011-08-31 01:23:29 +0000
commitdebc98eb182d845e4ab803c1cd1d84908da745d3 (patch)
tree178b95a43aceb14c427fb49a7e185115eaab6b39 /Source/SPWindow.m
parenta15f9f07c618351d61cc1991edf8c8b892e7d13e (diff)
downloadsequelpro-debc98eb182d845e4ab803c1cd1d84908da745d3.tar.gz
sequelpro-debc98eb182d845e4ab803c1cd1d84908da745d3.tar.bz2
sequelpro-debc98eb182d845e4ab803c1cd1d84908da745d3.zip
- Clean up undo manager handling
- Implement an undo manager per tab (strictly speaking, per connection 'document'), addressing Issue #1109.
Diffstat (limited to 'Source/SPWindow.m')
-rw-r--r--Source/SPWindow.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/SPWindow.m b/Source/SPWindow.m
index 414d043a..2f5cf56e 100644
--- a/Source/SPWindow.m
+++ b/Source/SPWindow.m
@@ -115,5 +115,19 @@
[super sendEvent:theEvent];
}
+/**
+ * If this window is controlled by an SPWindowController, and thus supports being asked
+ * for the frontmost SPTableDocument, request the undoController for that table
+ * document. This allows undo to be individual per tab rather than shared across the
+ * window.
+ */
+- (NSUndoManager *)undoManager
+{
+ if ([[self windowController] respondsToSelector:@selector(selectedTableDocument)]) {
+ NSLog(@"Test: %@", [[[[self windowController] selectedTableDocument] undoManager] description]);
+ return [[[self windowController] selectedTableDocument] undoManager];
+ }
+ return [super undoManager];
+}
@end