go-runewidth – github.com/mattn/go-runewidth Index | Files

package runewidth

import "github.com/mattn/go-runewidth"

Index

Variables

var DefaultCondition = &Condition{EastAsianWidth}
var EastAsianWidth = IsEastAsian()

Functions

func FillLeft

func FillLeft(s string, w int) string

func FillRight

func FillRight(s string, w int) string

func IsAmbiguousWidth

func IsAmbiguousWidth(r rune) bool

IsAmbiguousWidth returns whether is ambiguous width or not.

func IsEastAsian

func IsEastAsian() bool

func IsNeutralWidth

func IsNeutralWidth(r rune) bool

IsAmbiguousWidth returns whether is ambiguous width or not.

func RuneWidth

func RuneWidth(r rune) int

RuneWidth returns the number of cells in r. See http://www.unicode.org/reports/tr11/

func StringWidth

func StringWidth(s string) (width int)

func Truncate

func Truncate(s string, w int, tail string) string

func Wrap

func Wrap(s string, w int) string

Types

type Condition

type Condition struct {
	EastAsianWidth bool
}

func NewCondition

func NewCondition() *Condition

func (*Condition) FillLeft

func (c *Condition) FillLeft(s string, w int) string

func (*Condition) FillRight

func (c *Condition) FillRight(s string, w int) string

func (*Condition) RuneWidth

func (c *Condition) RuneWidth(r rune) int

RuneWidth returns the number of cells in r. See http://www.unicode.org/reports/tr11/

func (*Condition) StringWidth

func (c *Condition) StringWidth(s string) (width int)

func (*Condition) Truncate

func (c *Condition) Truncate(s string, w int, tail string) string

func (*Condition) Wrap

func (c *Condition) Wrap(s string, w int) string

Source Files

runewidth.go runewidth_posix.go

Version
v0.0.1
Published
Mar 15, 2016
Platform
darwin/amd64
Imports
3 packages
Last checked
20 hours ago

Tools for package owners.