Add unit tests for escape sequence parse functions (#2116)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-08-26 14:49:33 +10:00
1 parent 04afd78e65
commit 8f97bf806a
4 files changed
+67 -28

No files matched your search

-8
View File
@@ -88,14 +88,6 @@ func parseStyles() styleMap {
return sm
}
func parseEscapeSequence(s string) tcell.Style {
s = strings.TrimPrefix(s, "\033[")
if i := strings.IndexByte(s, 'm'); i >= 0 {
s = s[:i]
}
return applyAnsiCodes(s, tcell.StyleDefault)
}
func parseColor(toks []string) (tcell.Color, int, error) {
if len(toks) == 0 {
return tcell.ColorDefault, 0, fmt.Errorf("invalid args: %v", toks)