Fix themes kitten not displaying colors in narrow windows

The themes kitten used the truncated color name when formatting the
colors themselves, which leads to broken coloring when the window is
narrow enough to cause truncation to occur.
This commit is contained in:
Ethan Wu 2024-07-08 22:41:29 -07:00
parent e45d518082
commit 87a9a60442

View file

@ -451,10 +451,11 @@ func (self *handler) draw_theme_demo() {
if intense {
s = "bright-" + s
}
if len(s) > trunc {
s = s[:trunc]
sTrunc := s
if len(sTrunc) > trunc {
sTrunc = sTrunc[:trunc]
}
buf.WriteString(self.lp.SprintStyled("fg="+s, s))
buf.WriteString(self.lp.SprintStyled("fg="+s, sTrunc))
buf.WriteString(" ")
}
text := strings.TrimSpace(buf.String())