Skip to main content

Module modes

Module modes 

Source
Expand description

oil-mode – major mode for the oil.nvim-style editable directory listing buffer.

Lives here (rather than in lattice-mode) per the mode-architecture convention: “a mode lives with the crate that owns its associated feature.” OilBuffer lives in this crate, so the mode + the oil-mode-owned BufferLocal state (OilDir) live here too.

The mode itself is metadata only: kind = Major, no contributed options (oil is writable so it contributes no ReadOnly override), no capability requirements, no-op lifecycle hooks. Behaviour – navigation, the rope-vs-snapshot diff, the filesystem-op planner – lives on OilBuffer and the consumer’s App surface.

Structs§

OilDir
BufferLocal carrying the filesystem path the oil buffer’s listing represents (M.3.2.c.3 mirror of OilBuffer::dir). Renderers / writers read through this rather than poking OilBuffer::dir directly so the canonical “what directory does this oil buffer represent” lookup is uniform with the rest of the mode-owned per-buffer state.
OilMode
Major mode for oil-style directory-listing buffers. Any buffer whose major is oil-mode is an OilBuffer; the renderer dispatches accordingly.
OilSnapshotLocal
DL.5: the directory state :w diffs against.

Functions§

register_oil_modes
Register every lattice-oil-owned mode against registry. Called from the App’s boot path alongside lattice_mode::register_foundation_modes, lattice_syntax::register_language_modes, and lattice_lsp::register_lsp_log_modes. Mirrors the same per-feature-crate registration pattern.