uwidth

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCIIIcon

func ASCIIIcon(icon string, asciiMode bool) string

ASCIIIcon returns a single-cell substitute when asciiMode is on and icon looks wide/emoji.

func ContainsWide

func ContainsWide(s string) bool

ContainsWide reports whether s has any double-width rune.

func FitLabel

func FitLabel(s string, cols int) string

FitLabel keeps label within cols, preferring ASCII when needed.

func IconCells

func IconCells(icon string, asciiMode bool) int

StripForHit returns display width to use for hit-testing an icon glyph.

func Pad

func Pad(s string, cols int) string

Pad pads s with spaces to exactly cols display cells (truncates if longer).

func Rune

func Rune(r rune) int

func String

func String(s string) int

func Truncate

func Truncate(s string, maxCols int) string

Truncate returns s fitting in maxCols cells, appending "…" if cut.

Types

This section is empty.

Jump to

Keyboard shortcuts

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