pub struct TableInfo {
pub rows_span: Range<usize>,
pub end_src: usize,
pub prefix: Vec<Glyph>,
pub grid: Vec<TableRow>,
}Expand description
A table’s structure, published alongside the box-drawn rows that spell it.
The rows in VisualMap::rows are the default monospace picture of a
table: every border a │, every column a whole number of character cells.
That picture is exactly right on any monospace surface, and unfixable off one
— in a proportional font the │s of two rows land at different x and the grid
shears. So a frontend that draws its own geometry reads this instead: the
cells, their alignment, and which rows are the head, with no opinion about
how wide a column is or what a border looks like.
Both are always built. The TUI paints rows and ignores this; the GUI skips
rows for the span in rows_span and draws from here. They describe the
same cells, so the caret lands on the same offsets either way.
Fields§
§rows_span: Range<usize>The VisualMap::rows this table’s picture occupies, borders included —
what a frontend drawing its own table skips over.
end_src: usizeThe source span of the table node, and the offset its trailing caret stop sits at.
prefix: Vec<Glyph>The block prefix every row of this table carries — a blockquote’s │
gutter, a list item’s indent. Empty for a table at the top level.
A frontend drawing its own grid has to render this and start the table past it, exactly as the picture does; a table nested in a quote that draws flush at the left margin has left the quote.
grid: Vec<TableRow>