package wcwidth
import "src.elv.sh/pkg/wcwidth"
Package wcwidth provides utilities for determining the column width of characters when displayed on the terminal.
Index ¶
- func Force(s string, width int) string
- func Of(s string) (w int)
- func OfRune(r rune) int
- func Override(r rune, w int)
- func Trim(s string, wmax int) string
- func TrimEachLine(s string, width int) string
- func Unoverride(r rune)
Package Files ¶
func Force ¶
Force forces the string s to the given column width by trimming and padding.
func Of ¶
Of returns the column width of a string, assuming no soft line breaks.
func OfRune ¶
OfRune returns the column width of a rune.
func Override ¶
Override overrides the column width of a rune to be a specific non-negative value. If w < 0, it removes the override.
func Trim ¶
Trim trims the string s so that it has a column width of at most wmax.
func TrimEachLine ¶
TrimEachLine trims each line of s so that it is no wider than the specified width.
func Unoverride ¶
Unoverride removes the column width override of a rune.
Package wcwidth imports 3 packages (graph) and is imported by 6 packages. Updated now.
Tools for package owners.