MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / runeDisplayWidth

Function runeDisplayWidth

core/cmd/server/cmd/user.go:179–190  ·  view source on GitHub ↗
(r rune)

Source from the content-addressed store, hash-verified

177}
178
179func runeDisplayWidth(r rune) int {
180 if r == 0 {
181 return 0
182 }
183 if r < 32 || (r >= 0x7f && r < 0xa0) {
184 return 0
185 }
186 if isWideRune(r) {
187 return 2
188 }
189 return 1
190}
191
192func isWideRune(r rune) bool {
193 if r < 0x1100 {

Callers 1

displayWidthFunction · 0.85

Calls 1

isWideRuneFunction · 0.85

Tested by

no test coverage detected