pub struct AnnotationColumns { /* private fields */ }Expand description
MARG.5 (2026-06-03): pre-computed per-category column layout for the picker / completion annotation column. The renderer builds one of these from the visible candidate set, then renders each row against it — every row’s annotation cells line up vertically because each column width is the max across visible candidates and rows that don’t have a particular category render a blank cell of the same width.
Why this lives in lattice-completion rather than the
renderer crates: both peer renderers (TUI + GPUI) need
identical column-width math; centralising avoids two
implementations drifting apart. The layout is data, not
paint — peers consume it differently (ratatui spans vs.
GPUI element-tree), but the column widths are universal.
Display order is variant-fixed via category_order:
keybinding -> source -> kind -> doc -> custom (custom
slots come last, grouped at the end). Source sits right
after keybinding so the user sees which mode contributes
the chord at a glance.
Implementations§
Source§impl AnnotationColumns
impl AnnotationColumns
Sourcepub fn from_visible<'a, I>(candidates: I) -> Selfwhere
I: IntoIterator<Item = &'a RenderedCandidate>,
pub fn from_visible<'a, I>(candidates: I) -> Selfwhere
I: IntoIterator<Item = &'a RenderedCandidate>,
Build the column layout from a borrowed iterator over
the visible candidates. chars().count() is used for
width — matches what display_text() yields and what
monospace terminals draw. (Combining-char / wide-glyph
edge cases are not handled here for parity with the
existing display_col_chars calculation in the picker
caller; a future Unicode-width pass would land in both
sites at once.)
Trait Implementations§
Source§impl Clone for AnnotationColumns
impl Clone for AnnotationColumns
Source§fn clone(&self) -> AnnotationColumns
fn clone(&self) -> AnnotationColumns
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more