Documentation
¶
Overview ¶
Package textwidth measures text by the columns it takes in a terminal, and cuts it to them, so that what is written beside it lines up whatever characters it has.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OneLine ¶
OneLine returns s with each run of white space and control characters made one space, and those at its ends left out, so that it keeps to the line it is written on, and without format characters, such as one that turns the text after it right to left, which would change how the rest of the line reads.
func Truncate ¶
Truncate returns s cut to at most maxWidth columns, ending in an ellipsis when it was cut. A character is kept or left out with the marks and the emoji modifiers that follow it, and a wide one that would go past maxWidth is left out whole, so what is returned may be a column narrower. Nothing is left of s when maxWidth is less than one.
Types ¶
This section is empty.