Skip to main content

Module diff

Module diff 

Source
Expand description

Diff-mode subsystem: engine (pure line + word diff), hunk (data types), state::DiffState (session state owned by EditorState::diff while Mode::Diff is active), and layout (the stacked visual-line model shared by renderer and scroll math). See docs/dev/diff-review.md.

Re-exports§

pub use engine::compute;
pub use engine::HunkIdAllocator;
pub use hunk::Decision;
pub use hunk::Hunk;
pub use hunk::HunkId;
pub use hunk::HunkKind;
pub use hunk::InlineSide;
pub use hunk::InlineSpan;
pub use layout::DiffLineSource;
pub use layout::DiffVisualLine;
pub use state::DiffState;
pub use state::ReconcileOutcome;

Modules§

engine
Line-level + inline-word diff over two strings, producing the Hunk sequence consumed by crate::diff::DiffState. Wraps similar::TextDiff::from_lines so nothing else imports similar directly, and adds two things on top:
hunk
Hunk types for the diff subsystem. Line ranges are half-open [start, end); an Insert has an empty old_lines, a Delete an empty new_lines.
layout
Visual-line model and layout cache for the diff view.
state
DiffState — the in-flight review session attached to EditorState::diff while Mode::Diff is active. Owns the pre-change rope, the working new-side buffer, the hunk list, per-hunk decisions, and focus. See docs/dev/diff-review.md.