diff options
Diffstat (limited to 'Source/SPWindow.m')
-rw-r--r-- | Source/SPWindow.m | 14 |
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 |