RecordEditHistory
Forms, interaction, edit history
Description
Records one whole-value change as a compact delta entry in the history of the active edit
The old and new values are compared to find their shared prefix and suffix, and only the differing middle sections are stored as removed and inserted text
The directed anchor and caret positions before and after the change are captured alongside the delta, so undo and redo can restore the selection exactly
Recording removes any redo branch that followed the current history position and is skipped while MaxUndoSteps is zero
Declaration
procedure RecordEditHistory(const OldValue, NewValue: WideString;
BeforeAnchor, BeforeCaret, AfterAnchor, AfterCaret: Integer);
Parameters
| OldValue | Transient value before the change |
|---|---|
| NewValue | Transient value after the change |
| BeforeAnchor | Selection anchor position before the change |
| BeforeCaret | Selection caret position before the change |
| AfterAnchor | Selection anchor position after the change |
| AfterCaret | Selection caret position after the change |
See also
AddEditHistory, ApplyEditHistory, TrimEditHistory, SetEditValue, UndoEdit