MCPcopy Create free account
hub / github.com/gokcehan/lf / optionToFmtstr

Function optionToFmtstr

termseq.go:96–102  ·  view source on GitHub ↗

optionToFmtstr takes an escape sequence option (e.g. `\033[1m`) and outputs a complete format string (e.g. `\033[1m%s\033[0m`).

(optstr string)

Source from the content-addressed store, hash-verified

94// optionToFmtstr takes an escape sequence option (e.g. `\033[1m`) and outputs
95// a complete format string (e.g. `\033[1m%s\033[0m`).
96func optionToFmtstr(optstr string) string {
97 if !strings.Contains(optstr, "%s") {
98 return optstr + "%s\033[0m"
99 } else {
100 return optstr
101 }
102}
103
104// parseEscapeSequence takes an escape sequence option (e.g. `\033[1m`) and
105// converts it to a [tcell.Style] object.

Callers 4

TestOptionToFmtstrFunction · 0.85
printDirMethod · 0.85
echoerrMethod · 0.85
drawRulerFileMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestOptionToFmtstrFunction · 0.68