struct

Phosphor::Cell

Inherits Struct < Value < Object

One terminal cell: a grapheme cluster, its visual style, and its display width.

Wide characters (CJK, most emoji) occupy two adjacent cells. Buffer#set_string writes the primary Cell into the first slot and Cell::CONTINUATION into the second so that the diff renderer can identify and rewrite both slots as an atomic pair.

Use Width.of(char) — never String#size — to determine width.

Constants

CONTINUATION = new(cluster: "\u0000", style: Style.new, width: 0)

Sentinel placed in the second slot of every wide (2-cell) character. Identify it with cell == Cell::CONTINUATION; never write to it directly.

Constructors

new(cluster : String, style : Style, width : Int32)
Source

Instance methods

cluster
Source
style
Source
width
Source