Skip to main content

Module options

Module options 

Source
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§

UiDiffContext
Number of unchanged context lines to keep visible above and below each change when UiDiffFoldUnchanged folds a diff. Default 6 — vimdiff’s diffopt context:6. Mirrors VS Code’s diffEditor.hideUnchangedRegions.contextLineCount.
UiDiffFoldUnchanged
Fold the unchanged regions of a diff so only the changes (± UiDiffContext lines) remain visible — vimdiff’s foldmethod=diff, VS Code’s “Collapse Unchanged Regions”.
UiDiffLineBackgrounds
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 + / -.