Posted 18 years ago
by Roy Arvenäs
-
Software Developer,
TAT - The Astoning Tribe
Version: 4.0.0253
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Hello
I have an issue with undo/redo and the modified flag of a SyntaxEditors document.
When I undo until a point where the document was not modified, it correctly sets the modified flag to false, but when I use redo, it sets modified to false one "step" after the document is back to unmodified state.
Example:
1)
Document
---------------------------------------------
Saved Saved Saved
at this point I set the modified flag to false, since the user has pressed save.
2)
I then Add some more text
Document
---------------------------------------------
Saved Saved Saved new text that is not saved
Modified: true (Correct)
3)
I undo so that my new text is removed going back to:
Document
---------------------------------------------
Saved Saved Saved
Modified: false (correct)
4)
I Undo one more step.
Document
---------------------------------------------
Modified: true (correct)
5)
I then redo again
Document
---------------------------------------------
Saved Saved Saved
Modified: true (incorrect)
6)
One more redo
Document
---------------------------------------------
Saved Saved Saved new text that is not saved
Modified: false (incorrect)
As can be seen in step 6, I get the flag set to false by redo, but it is done one step too late.
So, is this a bug, or am I doing something wrong when I reset the modified flag?
Sincerily
Roy Arvenäs, TAT
I have an issue with undo/redo and the modified flag of a SyntaxEditors document.
When I undo until a point where the document was not modified, it correctly sets the modified flag to false, but when I use redo, it sets modified to false one "step" after the document is back to unmodified state.
Example:
1)
Document
---------------------------------------------
Saved Saved Saved
at this point I set the modified flag to false, since the user has pressed save.
2)
I then Add some more text
Document
---------------------------------------------
Saved Saved Saved new text that is not saved
Modified: true (Correct)
3)
I undo so that my new text is removed going back to:
Document
---------------------------------------------
Saved Saved Saved
Modified: false (correct)
4)
I Undo one more step.
Document
---------------------------------------------
Modified: true (correct)
5)
I then redo again
Document
---------------------------------------------
Saved Saved Saved
Modified: true (incorrect)
6)
One more redo
Document
---------------------------------------------
Saved Saved Saved new text that is not saved
Modified: false (incorrect)
As can be seen in step 6, I get the flag set to false by redo, but it is done one step too late.
So, is this a bug, or am I doing something wrong when I reset the modified flag?
Sincerily
Roy Arvenäs, TAT