wcwidth

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Force

func Force(s string, width int) string

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

func Of

func Of(s string) (w int)

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

func OfRune

func OfRune(r rune) int

OfRune returns the column width of a rune.

func Override

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

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

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

func Unoverride(r rune)

Unoverride removes the column width override of a rune.

Types

This section is empty.

Jump to

Keyboard shortcuts

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