Add editor packages

This commit is contained in:
dwrz
2026-10-26 02:32:03 +00:00
parent 38714f6c80
commit 4ed2ee97e0
23 changed files with 2114 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
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)
}
}