fix: a wrapped value in the details keeps its colour on every line
CI / Checks (pull_request) Successful in 35s
PR title / Conventional title (pull_request) Successful in 2s

This commit is contained in:
keb authored and Karl-Einar Bergstrøm committed 2026-10-14 21:23:07 +02:00
1 parent e825a51b30
commit 3eb88689fa
2 files changed
+36 -1

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
package panes
import (
"strings"
"testing"
)
func TestWrappedValueKeepsItsStyle(t *testing.T) {
red := "\x1b[31m"
got := carryStyle([]string{red + "@Microsoft.KeyVault(SecretUri=https://kv", "-app-prod.vault.azure.net/secrets/x)\x1b[m", "after"})
if !strings.HasPrefix(got[1], red) {
t.Errorf("the wrapped line lost the style: %q", got[1])
}
if strings.HasPrefix(got[2], red) {
t.Errorf("the style went on past its reset: %q", got[2])
}
}