diff options
| author | Neil <nyamatongwe@gmail.com> | 2014-07-18 23:37:23 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2014-07-18 23:37:23 +1000 |
| commit | 286895b1a01a6fd57b9fd5044efad711e9c2216b (patch) | |
| tree | f8fbc009263db18ff89876e4600ac5910c3e227d /src/CellBuffer.h | |
| parent | 2fc9c2d3742b5b09a6e1ec40d32e4d93f83df5ca (diff) | |
| download | scintilla-mirror-286895b1a01a6fd57b9fd5044efad711e9c2216b.tar.gz | |
Added the tentative undo feature. This is useful for IMEs that want to display
and manipulate a character being composed, but may then commit or remove it
leaving no history in undo of the intermediate forms.
Diffstat (limited to 'src/CellBuffer.h')
| -rw-r--r-- | src/CellBuffer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/CellBuffer.h b/src/CellBuffer.h index f07b45983..5e4fc7c8c 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -95,6 +95,7 @@ class UndoHistory { int currentAction; int undoSequenceDepth; int savePoint; + int tentativePoint; void EnsureUndoRoom(); @@ -117,6 +118,12 @@ public: void SetSavePoint(); bool IsSavePoint() const; + // Tentative actions are used for input composition so that it can be undone cleanly + void TentativeStart(); + void TentativeCommit(); + bool TentativeActive() const { return tentativePoint >= 0; } + int TentativeSteps(); + /// To perform an undo, StartUndo is called to retrieve the number of steps, then UndoStep is /// called that many times. Similarly for redo. bool CanUndo() const; @@ -193,6 +200,11 @@ public: void SetSavePoint(); bool IsSavePoint() const; + void TentativeStart(); + void TentativeCommit(); + bool TentativeActive() const; + int TentativeSteps(); + bool SetUndoCollection(bool collectUndo); bool IsCollectingUndo() const; void BeginUndoAction(); |
