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

Function StyleText

internal/app/theme.go:377–387  ·  view source on GitHub ↗

StyleText maps ASCII letters/digits to the mode's Unicode variant.

(s string, mode TextStyleMode)

Source from the content-addressed store, hash-verified

375
376// StyleText maps ASCII letters/digits to the mode's Unicode variant.
377func StyleText(s string, mode TextStyleMode) string {
378 if mode == TextPlain {
379 return s
380 }
381 var b strings.Builder
382 b.Grow(len(s) * 4)
383 for _, r := range s {
384 b.WriteRune(styleRune(r, mode))
385 }
386 return b.String()
387}
388
389// StyleViewText applies styleRune to a pre-rendered string while passing
390// through ANSI CSI escape sequences untouched. Useful when post-processing

Callers 3

drawNoteFrameFunction · 0.85
drawNoteInternalFunction · 0.85
SampleMethod · 0.85

Calls 1

styleRuneFunction · 0.85

Tested by

no test coverage detected