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

OldValueTransient value before the change
NewValueTransient value after the change
BeforeAnchorSelection anchor position before the change
BeforeCaretSelection caret position before the change
AfterAnchorSelection anchor position after the change
AfterCaretSelection caret position after the change

See also

AddEditHistory, ApplyEditHistory, TrimEditHistory, SetEditValue, UndoEdit