From 38d2856d341358bf9c691157ae0ca2e8960e35df Mon Sep 17 00:00:00 2001
From: Neil
The history should first be set up with SCI_PUSHUNDOACTIONTYPE, and
- SCI_CHANGELASTUNDOACTIONTEXT then the save, current, and tentativ points set
- with SCI_SETUNDOSAVEPOINT, SCI_SETUNDOCURRENT, and
- SCI_SETUNDOTENTATIVE.
+ SCI_CHANGELASTUNDOACTIONTEXT then the save, current, and tentative points set
+ with SCI_SETUNDOSAVEPOINT, SCI_SETUNDOTENTATIVE, and
+ SCI_SETUNDOCURRENT.
SCI_PUSHUNDOACTIONTYPE(int type, position pos) appends an action to the undo stack
@@ -2073,6 +2073,14 @@ struct Sci_TextToFindFull {
SCI_CHANGELASTUNDOACTIONTEXT(position length, const char *text).
+ The last restoration API called should be SCI_SETUNDOCURRENT as this validates
+ the restored history and values against the document. For example, an undo history that could cause a negative
+ document length or inserting / removing text outside the document is invalid.
+ If the restored undo state is invalid then a failure status is set and the undo history cleared.
+ Check for failure with SCI_GETSTATUS.
+
The current implementation may only work when the current and save point are the same and there is no tentative point.
-- cgit v1.2.3