Skip to main content

Module width

Module width 

Source
Expand description

Width guards for transcript rendering with fixed prefix columns.

Several rendering paths reserve a fixed number of columns for bullets, gutters, or labels before laying out content. When the terminal is very narrow, those reserved columns can consume the entire width, leaving zero or negative space for content.

These helpers centralise the subtraction and enforce a strict-positive contract: they return Some(n) where n > 0, or None when no usable content width remains. Callers treat None as “render prefix-only fallback” rather than attempting wrapped rendering at zero width, which would produce empty or unstable output.

Functions§

usable_content_width
Returns usable content width after reserving fixed columns.
usable_content_width_u16
u16 convenience wrapper around usable_content_width.