Closed sruehl closed 3 weeks ago
Colors don't reset when using Bolt or Italic from https://github.com/fatih/color for example. Here is a testcase demonstration the current issue:
package tview import ( "github.com/fatih/color" "testing" ) func TestTranslateANSIBroken(t *testing.T) { info := color.New(color.FgGreen, color.Bold).Sprint info2 := color.New(color.FgGreen, color.Italic).Sprint color.NoColor = false greenText := info("this should be colored green and bolt") t.Log(greenText) greenText2 := info2("this should be colored green and italic") t.Log(greenText2) t.Log(TranslateANSI(greenText + " uncolored " + greenText2)) }
the offending line is this one if len(params) == 0 || len(fields) == 0 && fields[0] == "0" {
if len(params) == 0 || len(fields) == 0 && fields[0] == "0" {
With the above code corrected the output is like that:
Thanks. The latest commit fixes this and some other issues in the ANSI translation code.
Colors don't reset when using Bolt or Italic from https://github.com/fatih/color for example. Here is a testcase demonstration the current issue:
the offending line is this one
if len(params) == 0 || len(fields) == 0 && fields[0] == "0" {
With the above code corrected the output is like that: