Skip to main content

Module inverse_op

Module inverse_op 

Source
Expand description

Inverse-op derivation for undo recording.

Given an EditOp, the substring it removed (empty for Insert), and the post-edit rope, return the op that would undo it. Pure logic; the recovery path uses it on replayed edits to reconstruct undo records without having the pre-edit rope on hand.

Functionsยง

compute_inverse_op
Compute the inverse of op given the original removed text and the post-edit rope. Pure logic; reusable by recovery (which has only (rope_after, op, removed_text)) as well as by the core thread.