Documentation ¶
Overview ¶
Package width defines an interface, `StringWidther`, and a couple of trivial implementations of that interface, to allow you to build things where the length of a string and its width on screen are independent of one another. This is useful for embedding escape sequences, for example, as well as for accounting for glyphs of varying on-screen width.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StringAndWidth ¶
StringAndWidth keeps track of its string and its width independent and explicitly.
func (StringAndWidth) String ¶
func (sw StringAndWidth) String() string
func (StringAndWidth) Width ¶
func (sw StringAndWidth) Width() int
Width of a StringAndWidth is whatever it was set to.
type StringWidther ¶
The StringWidther interface is the basic interface this package builds on.
Click to show internal directories.
Click to hide internal directories.