Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 16236 - Undo goes past last Save
Summary: Undo goes past last Save
Status: RESOLVED DUPLICATE of bug 2281
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-17 08:34 EDT by Randy Hudson CLA
Modified: 2002-05-17 17:05 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2002-05-17 08:34:36 EDT
The undo stack should be flushed when a Save is performed.
Also, the dirty bit should be set to false when there is nothing left to undo.  
This is the case where the contents of the editor are identical to the contents 
on disk.
Comment 1 Jared Burns CLA 2002-05-17 08:50:40 EDT
Absolutely not. With autobuilding on, you often don't realize that 
something was a bonehead mistake until after you save and autobuild 
completes. In my experience undo is most useful right after I save.
Comment 2 David Whiteman CLA 2002-05-17 08:57:59 EDT
I agree with the 2nd part that the dirty bit should be set to false, when you 
go back to the state of when the editor was first opened.

However, I agree with Jared that undo should be allowed to go past save.
Comment 3 Randy Hudson CLA 2002-05-17 09:10:03 EDT
I can live with just the second request.  The most common case for me, since I 
use a lot of mnemonics, is that a character gets dumped in the Editor by 
accident.  Allowing undo to "clean" the dirty flag would solve my 80% case.

I'm guessing this will be implemented in UI, not JDT.  But I wanted to bring it 
up as a Java thing since people are most religious about source code.
Comment 4 Stein M. Eliassen CLA 2002-05-17 09:15:47 EDT
Remember that Redo must also reset the dirty-flag.
Comment 5 Johan Compagner CLA 2002-05-17 09:26:14 EDT
undo should be kept as much as possible.
example:

state 1> I open the file, 
state 2> make some modifications, (dirty bit on)
state 3> save the file, (dirty bit off)
state 4> make some modifications, (dirty bit on)
state 5> go back to <3> with undo,undo, (dirty bit off!)
state 6> again undo so i am now in <2>, dirty bit again to ON.

(then redo to <3> will set dirty bit to off and again redo so <4>
will set the dirty bit again to on

then we can do everything and still know when it is the same as on disk
Comment 6 Jared Burns CLA 2002-05-17 11:13:58 EDT

*** This bug has been marked as a duplicate of 2281 ***
Comment 7 David J. Orme CLA 2002-05-17 17:05:52 EDT
I concur with Randy and Johan--the dirty bit should be reset when undo or redo
match what is on disk, but the undo buffer should go back as far as you have
memory to go.

If the behavior proposed in this bug is implemented, I propose that it be made
an option configurable via preferences (the Borland IDEs do this).


Dave Orme