elvish: github.com/elves/elvish/pkg/wcwidth Index | Files

package wcwidth

import "github.com/elves/elvish/pkg/wcwidth"

Package wcwidth provides utilities for determining the column width of characters when displayed on the terminal.

Index

Package Files

wcwidth.go

func Force Uses

func Force(s string, width int) string

Force forces the string s to the given column width by trimming and padding.

func Of Uses

func Of(s string) (w int)

Of returns the column width of a string, assuming no soft line breaks.

func OfRune Uses

func OfRune(r rune) int

OfRune returns the column width of a rune.

func Override Uses

func Override(r rune, w int)

Override overrides the column width of a rune to be a specific non-negative value. It panics if w < 0.

func Trim Uses

func Trim(s string, wmax int) string

Trim trims the string s so that it has a column width of at most wmax.

func TrimEachLine Uses

func TrimEachLine(s string, width int) string

TrimEachLine trims each line of s so that it is no wider than the specified width.

func Unoverride Uses

func Unoverride(r rune)

Unoverride removes the column width override of a rune.

Package wcwidth imports 2 packages (graph) and is imported by 5 packages. Updated 2020-04-07. Refresh now. Tools for package owners.