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)
| 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`). |
| 96 | func 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. |
no outgoing calls