feat: the value's keys on the line below it: reveal and copy #8

Merged
keb merged 3 commits from feat/value-hints into main 2026-10-11 10:38:00 +02:00
Showing only changes of commit e31716cb1d - Show all commits
+13 -6
View File
@@ -333,16 +333,23 @@ func (d Detail) lines(st styles.Styles) []string {
}
}
case ValueShown:
// Where the dots were, continuing under itself; the keys below.
first := true
for _, line := range strings.Split(d.value.Reveal(), "\n") {
for _, w := range strings.Split(ansi.Hardwrap(line, max(1, inner-11), true), "\n") {
if first {
out = append(out, " "+st.Label.Render(fmt.Sprintf("%-10s", label))+" "+st.Value.Render(w))
first = false
} else {
out = append(out, indent+st.Value.Render(w))
}
}
}
var more []string
if d.hidesIn != "" {
more = append(more, "hides in "+d.hidesIn)
}
out = append(out, " "+st.Label.Render(fmt.Sprintf("%-10s", label))+" "+hints("hide", more...))
for _, line := range strings.Split(d.value.Reveal(), "\n") {
for _, w := range strings.Split(ansi.Hardwrap(line, inner, true), "\n") {
out = append(out, " "+st.Value.Render(w))
}
}
out = append(out, indent+hints("hide", more...))
}
return append(out, d.versionLines(st)...)
}