cellwidth

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphemeClusterWidth

func GraphemeClusterWidth(gc []rune, offsetInLine uint64, tabSize uint64) uint64

GraphemeClusterWidth returns the width in cells of a grapheme cluster. It attempts to handle combining characters, emoji, and regional indicators reasonably, but can't be 100% accurate without knowing how the terminal will render the glyphs. Tab width is determined based on the position within the line.

func RuneWidth

func RuneWidth(r rune) uint64

RuneWidth returns the width in cells of an individual rune. Non-displayable characters and non-spacing marks are assigned a width of zero. Full-width East Asian characters are assigned a width of one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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