diff options
author | fvogel <fvogelnew1@free.fr> | 2016-07-06 17:00:05 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-07-06 17:00:05 (GMT) |
commit | bf98687ae68fe39f9b67d9cd3c1553bfdd43bf7b (patch) | |
tree | 6394f32e83be9b0c5fe08341ff25e6e1f1b7abb8 /generic | |
parent | c6333aba37203822399af655bd8eb008c6c154ec (diff) | |
download | tk-bf98687ae68fe39f9b67d9cd3c1553bfdd43bf7b.zip tk-bf98687ae68fe39f9b67d9cd3c1553bfdd43bf7b.tar.gz tk-bf98687ae68fe39f9b67d9cd3c1553bfdd43bf7b.tar.bz2 |
The undo marks identifier is now a member of textPtr->sharedTextPtr. This makes results of test text-8.22 independant of previous undo/redo actions on other text widgets.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkText.c | 5 | ||||
-rw-r--r-- | generic/tkText.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index 4195238..6b90a23 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2774,7 +2774,6 @@ TextPushUndoAction( { TkUndoSubAtom *iAtom, *dAtom; int canUndo, canRedo; - static int undoMarkId = -1; char lMarkName[20] = "tk::undoMarkL"; char rMarkName[20] = "tk::undoMarkR"; char stringUndoMarkId[7] = ""; @@ -2848,8 +2847,8 @@ TextPushUndoAction( Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj, Tcl_NewStringObj("set", 3)); markSetRUndoMarkCmdObj = Tcl_DuplicateObj(markSetLUndoMarkCmdObj); - undoMarkId++; - sprintf(stringUndoMarkId, "%d", undoMarkId); + textPtr->sharedTextPtr->undoMarkId++; + sprintf(stringUndoMarkId, "%d", textPtr->sharedTextPtr->undoMarkId); strcat(lMarkName, stringUndoMarkId); strcat(rMarkName, stringUndoMarkId); Tcl_ListObjAppendElement(NULL, markSetLUndoMarkCmdObj, diff --git a/generic/tkText.h b/generic/tkText.h index 5d88784..430c96b 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -580,6 +580,8 @@ typedef struct TkSharedText { * statements. */ int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ + int undoMarkId; /* Counts undo marks temporarily used during + undo and redo operations. */ int isDirty; /* Flag indicating the 'dirtyness' of the * text widget. If the flag is not zero, * unsaved modifications have been applied to |