aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/ScintillaDoc.html
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2024-02-15 14:17:08 +1100
committerNeil <nyamatongwe@gmail.com>2024-02-15 14:17:08 +1100
commit38d2856d341358bf9c691157ae0ca2e8960e35df (patch)
treea1a187630421e954b65181bb2d2fb4a58d2549ff /doc/ScintillaDoc.html
parenta6a2fe933e0103464c1a357f987ad10e3bcf6622 (diff)
downloadscintilla-mirror-38d2856d341358bf9c691157ae0ca2e8960e35df.tar.gz
Perform validation of undo state when SCI_SETUNDOCURRENT called, setting status
when invalid.
Diffstat (limited to 'doc/ScintillaDoc.html')
-rw-r--r--doc/ScintillaDoc.html14
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 12f2be0eb..4a10d280f 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -2063,9 +2063,9 @@ struct Sci_TextToFindFull {
</p>
<p>The history should first be set up with <code>SCI_PUSHUNDOACTIONTYPE</code>, and
- <code>SCI_CHANGELASTUNDOACTIONTEXT</code> then the save, current, and tentativ points set
- with <code>SCI_SETUNDOSAVEPOINT</code>, <code>SCI_SETUNDOCURRENT</code>, and
- <code>SCI_SETUNDOTENTATIVE</code>.
+ <code>SCI_CHANGELASTUNDOACTIONTEXT</code> then the save, current, and tentative points set
+ with <code>SCI_SETUNDOSAVEPOINT</code>, <code>SCI_SETUNDOTENTATIVE</code>, and
+ <code>SCI_SETUNDOCURRENT</code>.
</p>
<p><code>SCI_PUSHUNDOACTIONTYPE(int type, position pos)</code> appends an action to the undo stack
@@ -2073,6 +2073,14 @@ struct Sci_TextToFindFull {
<code>SCI_CHANGELASTUNDOACTIONTEXT(position length, const char *text)</code>.
</p>
+ <p>
+ The last restoration API called should be <code>SCI_SETUNDOCURRENT</code> 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 <a class="seealso" href="#SCI_GETSTATUS">SCI_GETSTATUS</a>.
+ </p>
+
<p>The current implementation may only work when the current and save point are the same and there is no tentative point.
</p>