Expand description
Read-only presentation of a diff the caller already computed.
Files, hunks, lines, line identities, old and new line numbers, marks and pre-classified code spans all come from the caller. This module computes no diff, parses no syntax, applies no patch and reads no filesystem.
§One renderer, two arrangements
Unified and split presentation use the same caller-supplied logical rows and the same line-side renderer. For a replacement, the caller supplies the aligned old and new sides: split mode places them opposite one another, while unified mode places them on consecutive fixed rows. The component never guesses which removal belongs with which addition.
§Large data
The hierarchy is flattened once per render, which walks all caller-owned
files, hunks and lines. The resulting fixed-height rows are handed to the
virtualized List, so only viewport rows are laid out
or published. The explicit price is the same one paid by virtualized
CodeView: long lines are clipped and do not horizontally scroll. This is
suitable for a large already-materialized diff, not for lazy diff loading.
Structs§
- Diff
File - One caller-supplied file and its hunks.
- Diff
Hunk - One caller-supplied hunk.
- Diff
Line - One stable, caller-supplied logical diff row.
- Diff
View - A virtualized, read-only diff presentation.
Enums§
- Diff
Presentation - How the same caller-supplied lines are arranged.
- Diff
View Event - An action on caller-owned diff identity.