File: wcwidth.go

package info (click to toggle)
golang-github-charmbracelet-x 0.0~git20251028.0cf22f8%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,940 kB
  • sloc: sh: 124; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Package wcwidth provides utilities for calculating character width.
package wcwidth

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

// RuneWidth returns fixed-width width of rune.
//
// Deprecated: this is now a wrapper around go-runewidth. Use go-runewidth
// directly.
func RuneWidth(r rune) int {
	return runewidth.RuneWidth(r)
}

// StringWidth returns fixed-width width of string.
//
// Deprecated: this is now a wrapper around go-runewidth. Use go-runewidth
// directly.
func StringWidth(s string) (n int) {
	return runewidth.StringWidth(s)
}