Expand description
The layout layer (0017, R6 in 0031): one line’s byte↔display-cell maps and grapheme boundaries. Every visible-line consumer — renderer, cursor placement, selection overlays, diagnostics, mouse hit-testing — reads this instead of deriving positions by char index.
Cells are id::DisplayColumn (unsaturated usize): positions past 65535
columns stay exact; u16 exists only at the final terminal conversion in
the renderer. Storage stays byte-native (ByteOffset is canonical); this
is the single translation seam. RopeGraphemes streams clusters off a
rope slice so long lines never pay a whole-line String or layout vector.
Structs§
- Cell
Clip - A glyph’s intersection with the visible cell window.
- Grapheme
Span - One grapheme cluster’s placement on the line.
- Layout
Checkpoint - Line
Layout - A laid-out line: grapheme spans in order.
- Line
Layout Index - Prepared
Line Layout - Rope
Graphemes - Streaming grapheme iteration over a rope slice, chunk-aligned like ropey’s own iteration: only a cluster crossing rope chunks needs an owned string. Carries the absolute cell so consumers never re-walk.
Constants§
Functions§
- clip
- Clip one grapheme span to
[origin, origin+width).Nonewhen the cluster occupies no cell in the window (zero-width or fully outside). - printable_
grapheme - A terminal cell must contain printable text, never protocol bytes. Use the same one-cell replacement in layout and emission; tab expansion is separate.
- printable_
text - Printable metadata with the same grapheme policy as buffer emission. Preserve an already-owned label without copying when no control needs replacing.