diff --git a/ChangeLog b/ChangeLog index 85d4499..1824d20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-01 Riccardo Mottola + + * Modules\Editors\ProjectCenter\PCEditor.m, + * Modules\Editors\ProjectCenter\PCEditor.m: + keep an undoManager for the Editor and return that to the window + 2010-05-30 03:42-EDT Gregory John Casamento * Modules/Projects/Application/Resources/main.m: Same as below. diff --git a/Modules/Editors/ProjectCenter/PCEditor.h b/Modules/Editors/ProjectCenter/PCEditor.h index 23f41e5..767a261 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.h +++ b/Modules/Editors/ProjectCenter/PCEditor.h @@ -1,10 +1,11 @@ /* GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html - Copyright (C) 2002-2004 Free Software Foundation + Copyright (C) 2002-2010 Free Software Foundation Authors: Philippe C.D. Robert Serg Stoyan + Riccardo Mottola This file is part of GNUstep. @@ -95,6 +96,9 @@ // further changes to the text view and infinite recursive invocations // of this method. BOOL editorTextViewIsPressingKey; + + // keep one undo manager for the editor + NSUndoManager *undoManager; } - (BOOL)editorShouldClose; diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index 3700b93..b939c45 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -199,6 +199,8 @@ isCharacterHighlit = NO; highlited_chars[0] = -1; highlited_chars[1] = -1; + + undoManager = [[NSUndoManager alloc] init]; } return self; @@ -229,6 +231,8 @@ RELEASE(backgroundColor); RELEASE(readOnlyColor); + RELEASE(undoManager); + [super dealloc]; } @@ -795,6 +799,13 @@ [self resignFirstResponder:_extEditorView]; } + +- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window +{ + return undoManager; +} + + // =========================================================================== // ==== TextView (_intEditorView, _extEditorView) delegate // =========================================================================== @@ -806,13 +817,6 @@ if ([object isKindOfClass:[PCEditorView class]] && (object == _intEditorView || object == _extEditorView)) { - /* - if (![self hasUndoManager]) - { - [self updateChangeCount: NSChangeDone]; - } - */ - if (_isEdited == NO) { [[NSNotificationCenter defaultCenter]