Expand description
M.2.b.3 (2026-06-01): excerpt-jump motions.
Four motions register against lattice-grammar’s
CommandRegistry and bind to ]e / [e / ]E / [E in
multibuffer-mode’s keymap layer:
| Chord | Motion id | Behaviour |
|---|---|---|
]e | multibuffer.next-excerpt-start | Cursor to first row of next excerpt |
[e | multibuffer.prev-excerpt-start | Cursor to first row of prev excerpt |
]E | multibuffer.next-file-boundary | Cursor to next excerpt with a different source |
[E | multibuffer.prev-file-boundary | Cursor to prev excerpt with a different source |
Handlers capture an Arc<MultibufferRegistryHandle> at
registration time, look up the typed handle via
ctx.buffer_id, and compute target rows from the captured
excerpts. Operators (d, c, y) compose with these motions
automatically — they fall out of lattice-grammar’s standard
operator+motion machinery, no per-motion plumbing.
No-op behaviour: cursor stays put when there is no
next / prev excerpt (e.g. cursor in the last excerpt, ]e
has no target).
See docs/dev/architecture/multibuffer-views.md §3.7 +
slice plan M.2.b.3.
Structs§
- Multibuffer
Motion Ids - The four motion ids registered by
register_multibuffer_motions. Boot wiring threads this struct into the keymap-layer push so chord bindings reach the right motion ids.
Functions§
- containing_
excerpt_ index - Index of the excerpt whose composed-row range contains
cursor_row.Nonewhen the cursor sits above the first excerpt (only possible on empty views or row 0 with no excerpts). - excerpt_
start_ rows - Composed-row position of each excerpt’s first row, in display
order. Equivalent to the prefix sum of
excerpt.line_count(). - next_
excerpt_ start_ row - Composed row of the
count-th excerpt strictly after the one containingcursor_row.Nonewhen there is no such excerpt. - next_
file_ boundary_ row - Composed row of the
count-th file-boundary excerpt forward of the boundary containing the current excerpt. A “file boundary” is the FIRST excerpt of each file group (per]Esemantics: jump to the start of the next file in the view). - prev_
excerpt_ start_ row - Composed row of the
count-th excerpt strictly before the one containingcursor_row.Nonewhen no such excerpt. - prev_
file_ boundary_ row - Composed row of the
count-th file-boundary excerpt backward of the boundary containing the current excerpt. A “file boundary” is the FIRST excerpt of each file group (per[Esemantics: jump to the start of the previous file). - register_
multibuffer_ motions - Register the four excerpt-jump motions against
registryand return their ids. Handlers capturemb_registry(cheap Arc clone) so they reach the typed view handle viactx.buffer_idat dispatch time.