feat: the value's keys on the line below it: reveal and copy #8
@@ -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)...)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user