Expand description
D-fix.5 (2026-06-26): diff-presentation options, owned by the diff
subsystem ([[feedback_mode_owns_its_surface]]) rather than host
core. Self-register via linkme like every other options! block;
the host’s init_from_linkme() walks the global slice at boot, so
linking lattice-diff into the binary (it always is — install
runs in the Phase-B list) picks these up automatically.
Both drive the universal UnchangedFoldSource (vimdiff
foldmethod=diff + diffopt context:N): in any diff session the
unchanged code between hunks is folded away so only the changes (±
context lines) show, on BOTH sides in lockstep.
Bound to the display group (visual-presentation toggles, next to
line numbers / wrap / whitespace). User customizes via
:set ui.diff.context=3 / :set ui.diff.fold-unchanged /
:customize display.
Structs§
- UiDiff
Context - Number of unchanged context lines to keep visible above and
below each change when
UiDiffFoldUnchangedfolds a diff. Default6— vimdiff’sdiffoptcontext:6. Mirrors VS Code’sdiffEditor.hideUnchangedRegions.contextLineCount. - UiDiff
Fold Unchanged - Fold the unchanged regions of a diff so only the changes (±
UiDiffContextlines) remain visible — vimdiff’sfoldmethod=diff, VS Code’s “Collapse Unchanged Regions”. - UiDiff
Line Backgrounds - Tint whole rows by what the diff did to them — added rows on an
add background, removed rows on a remove background — rather
than colouring only the leading
+/-.