width

package
v0.82.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphemeWidth

func GraphemeWidth(cluster []rune) int

func IsGraphemeExtend

func IsGraphemeExtend(r rune) bool

func IsRegionalIndicator

func IsRegionalIndicator(r rune) bool

func IsWideRune

func IsWideRune(r rune) bool

func NextGraphemeBoundary

func NextGraphemeBoundary(runes []rune, pos int) int

func PreviousGraphemeBoundary

func PreviousGraphemeBoundary(runes []rune, pos int) int

func RuneByteOffsets

func RuneByteOffsets(text string) []int

func TruncateFragmentToWidth

func TruncateFragmentToWidth(text string, maxWidth int) (string, int)

func VisibleWidthPlain

func VisibleWidthPlain(clean string) int

Types

type GraphemeSpan

type GraphemeSpan struct {
	Start int
	End   int
}

func GraphemeSpans

func GraphemeSpans(runes []rune) []GraphemeSpan

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL