Files
wen/internal/editor/buffer/glyph/glyph.go
T

16 lines
287 B
Go
Raw Normal View History

2026-10-26 02:32:03 +00:00
package glyph
import "github.com/mattn/go-runewidth"
// Width returns the terminal column width of a rune.
// Tabs use a fixed width of 8 columns.
// TODO: handle Unicode marks.
func Width(r rune) int {
switch r {
case '\t':
return 8
default:
return runewidth.RuneWidth(r)
}
}