Skip to main content

plan_revert

Function plan_revert 

pub fn plan_revert(
    doc: &mut AutoCommit,
    run: &ChangeRun,
    by: Option<&str>,
    authors: &AuthorDirectory,
) -> Result<RevertOutcome, RevertError>
Expand description

Work out what undoing run would do, without touching the document.

The dry run behind an affordance that must be explicit before the user commits to it — a menu item saying “undo, except the paragraph you edited” needs this, and so does a caller deciding whether to refuse.

§Errors

Propagates RevertError from run_bounds when run cannot be addressed in doc.