Documentation ¶
Overview ¶
Package buffer implements a 2-D buffer of cells.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer [][]*Cell
Buffer is a 2-D buffer of cells. The axes increase right and down. Uninitialized buffer is invalid, use New to create an instance. Don't set cells directly, use the SetCell method instead which safely handles limits and wide unicode characters.
func (Buffer) IsPartial ¶
IsPartial returns true if the cell at the specified point holds a part of a full width rune from a previous cell. See http://www.unicode.org/reports/tr11/.
func (Buffer) RemWidth ¶
RemWidth returns the remaining width (horizontal row of cells) available from and inclusive of the specified point.
func (Buffer) SetCell ¶
SetCell sets the rune of the specified cell in the buffer. Returns the number of cells the rune occupies, wide runes can occupy multiple cells when printed on the terminal. See http://www.unicode.org/reports/tr11/. Use the options to specify which attributes to modify, if an attribute option isn't specified, the attribute retains its previous value.
type Cell ¶
type Cell struct { // Rune is the rune stored in the cell. Rune rune // Opts are the cell options. Opts *cell.Options }
Cell represents a single cell on the terminal.
func NewCells ¶ added in v0.8.0
NewCells breaks the provided text into cells and applies the options.