Documentation ¶
Overview ¶
Package wrap implements line wrapping at character or word boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cells ¶
Cells returns the cells wrapped into individual lines according to the specified width and wrapping mode.
This function consumes any cells that contain newline characters and uses them to start new lines.
If the mode is AtWords, this function also drops cells with leading space character before a word at which the wrap occurs.
func ValidCells ¶
ValidCells validates the provided cells for wrapping. The text in the cells must follow the same rules as described for ValidText.
Types ¶
type Mode ¶
type Mode int
Mode sets the wrapping mode.
const ( // Never is the default wrapping mode, which disables line wrapping. Never Mode = iota // AtRunes is a wrapping mode where if the width of the text crosses the // width of the canvas, wrapping is performed at rune boundaries. AtRunes // AtWords is a wrapping mode where if the width of the text crosses the // width of the canvas, wrapping is performed at word boundaries. The // wrapping still switches back to the AtRunes mode for any words that are // longer than the width. AtWords )
Click to show internal directories.
Click to hide internal directories.