summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-07-24 18:31:10 (GMT)
committerhobbs <hobbs>2002-07-24 18:31:10 (GMT)
commit3aad9bd268b95f4f2f75819964fa69dbbf4f2016 (patch)
treec55a435277acec3ac172442daedcedcbbbac6bf1 /generic
parenta4cd1f0072763a70b0562a055503ffab26488db2 (diff)
downloadtk-3aad9bd268b95f4f2f75819964fa69dbbf4f2016.zip
tk-3aad9bd268b95f4f2f75819964fa69dbbf4f2016.tar.gz
tk-3aad9bd268b95f4f2f75819964fa69dbbf4f2016.tar.bz2
* generic/tkText.c (TextEditUndo): set isDirtyIncrement to -1 when
reverting to note proper "dirtiness". [Bug #580362] (callewaert)
Diffstat (limited to 'generic')
-rw-r--r--generic/tkText.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 7a929e8..bc9f98a 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkText.c,v 1.28 2002/06/22 08:21:51 hobbs Exp $
+ * RCS: @(#) $Id: tkText.c,v 1.29 2002/07/24 18:31:10 hobbs Exp $
*/
#include "default.h"
@@ -2743,28 +2743,32 @@ DumpSegment(interp, key, value, command, index, what)
* Side effects:
* None.
*/
-
-static int TextEditUndo (textPtr)
+
+static int
+TextEditUndo(textPtr)
TkText * textPtr; /* Overall information about text widget. */
{
int status;
-
- if ( ! textPtr->undo ) {
+
+ if (!textPtr->undo) {
return TCL_OK;
}
/* Turn off the undo feature */
-
textPtr->undo = 0;
- /* revert one compound action */
+ /* The dirty counter should count downwards as we are undoing things */
+ textPtr->isDirtyIncrement = -1;
+ /* revert one compound action */
status = TkUndoRevert(textPtr->undoStack);
+ /* Restore the isdirty increment */
+ textPtr->isDirtyIncrement = 1;
+
/* Turn back on the undo feature */
-
textPtr->undo = 1;
-
+
return status;
}
@@ -2779,7 +2783,8 @@ static int TextEditUndo (textPtr)
* None.
*/
-static int TextEditRedo (textPtr)
+static int
+TextEditRedo(textPtr)
TkText * textPtr; /* Overall information about text widget. */
{
int status;
@@ -2789,17 +2794,14 @@ static int TextEditRedo (textPtr)
}
/* Turn off the undo feature temporarily */
-
textPtr->undo = 0;
/* reapply one compound action */
-
status = TkUndoApply(textPtr->undoStack);
/* Turn back on the undo feature */
-
textPtr->undo = 1;
-
+
return status;
}