Skip to main content

Crate lattice_cells

Crate lattice_cells 

Source
Expand description

Cell-grid renderer substrate.

Pure data types: Cell, CellRow, CellChunk, CellMatrix, MatrixVersion. No rendering, no I/O, no rope dependencies. Both renderer crates (lattice-ui-tui, lattice-ui-gpui) and the host substrate (lattice-host) depend on this.

Construction logic — converting (rope, syntax spans, inlay hints, folds, theme) into CellRows and chunks — lands in S2 as a tokio worker in lattice-host. This crate’s responsibility ends at the type contracts.

Design anchor: docs/dev/architecture/cell-grid-renderer.md.

§Module layout

§Slicing

S1 (this crate) — types, slicing API, unit tests. S2 — cell-builder worker + RenderState integration. S3 — TUI cutover. S4 — GPU glyph atlas + paint_cells. S5 — bench + chunk-size + atlas tuning. S6 — cleanup (strip probes, retire shape_line on code path).

Re-exports§

pub use cell::Cell;
pub use cell::flags as cell_flags;
pub use chunk::CellChunk;
pub use coords::ConcealRange;
pub use coords::display_col_to_source_byte;
pub use coords::source_byte_to_display_col;
pub use coords::subtract_conceals;
pub use edit_delta::EditDelta;
pub use headerline::Headerline;
pub use headerline::HeaderlineProvider;
pub use headerline::HeaderlineRow;
pub use headerline::SimpleHeaderlineHandle;
pub use matrix::CHUNK_SIZE_WHOLE_DOC;
pub use matrix::CellMatrix;
pub use matrix::CellSlice;
pub use matrix::CellSliceIter;
pub use matrix::DisplayRowEntry;
pub use matrix::DisplaySlice;
pub use matrix::DisplaySliceIter;
pub use matrix::wrap_segments;
pub use media::MediaBlock;
pub use media::MediaBlockRef;
pub use media::MediaFit;
pub use media::MediaSource;
pub use row::CellRow;
pub use row::InlayOffset;
pub use row_weights::RowWeights;
pub use style::ExcerptHighlight;
pub use style::ExcerptHighlighter;
pub use style::RefineKind;
pub use style::RefineSpan;
pub use style::Style;
pub use style::StyledSpan;
pub use version::MatrixVersion;
pub use virtual_rows::AnchorPosition;
pub use virtual_rows::BASE_SCALE;
pub use virtual_rows::ProviderId;
pub use virtual_rows::ScaleRun;
pub use virtual_rows::VirtualRow;
pub use virtual_rows::VirtualRowKind;
pub use virtual_rows::VirtualRowMatrix;
pub use virtual_rows::VirtualRowProvider;
pub use virtual_rows::VirtualRowVersion;
pub use virtual_rows::coalesce_scales;

Modules§

cell
16-byte cell type — the atom of the cell-grid renderer.
chunk
Chunk of contiguous matrix rows.
context
Structural context scopes and the resolver that turns them into the header lines a pane pins above its text.
coords
Source byte → display column, in one place.
edit_delta
Cell-grid-specific edit delta — the input contract for incremental matrix rebuilds (S2.4.b).
headerline
Generic sticky headerline — the one mechanism for a buffer to surface a status row pinned above line 0.
matrix
The matrix: an ordered sequence of chunks the renderer slices.
media
IM.3 — the descriptor for an inline media block.
row
One renderable row of cells.
row_weights
IM.1 — how much vertical space a source line’s display rows occupy, measured in line-heights.
style
Syntax-highlight style types and the ExcerptHighlighter trait.
version
Version vector for the cell matrix.
virtual_rows
Virtual rows: a sibling lane to crate::CellMatrix for rows that displace content vertically without belonging to the source rope.