MCPcopy Create free account
hub / github.com/B33pBeeps/redthread / utf8Decode

Function utf8Decode

internal/app/render.go:317–323  ·  view source on GitHub ↗

utf8Decode is a thin wrapper. Kept separate so future width-aware logic (e.g. CJK double-width) can slot in here.

(s string)

Source from the content-addressed store, hash-verified

315// utf8Decode is a thin wrapper. Kept separate so future width-aware
316// logic (e.g. CJK double-width) can slot in here.
317func utf8Decode(s string) (rune, int) {
318 if len(s) == 0 {
319 return 0, 0
320 }
321 r, size := utf8.DecodeRuneInString(s)
322 return r, size
323}
324
325// effectiveStyleAt returns the SGR sequence active at visual column `col`
326// within string `s` — i.e., the last CSI seen before that column. An

Callers 4

StyleViewTextFunction · 0.85
splitAtVisualFunction · 0.85
visibleWidthFunction · 0.85
effectiveStyleAtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected