diff --git a/termui/help_bar.go b/termui/help_bar.go index f5222ea4f8a6a5a6c27e5ed285698e67f0b0e780..0174844e1afc5f8e1160299a7cb5a75086a4b403 100644 --- a/termui/help_bar.go +++ b/termui/help_bar.go @@ -16,14 +16,19 @@ type helpBar []struct { func (hb helpBar) Render(maxX int) string { var builder strings.Builder - for _, entry := range hb { - builder.WriteString(colors.White(colors.BlueBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text)))) - builder.WriteByte(' ') + + il := len(hb) - 1 + for i, entry := range hb { + builder.WriteString(colors.White(colors.BlackBg(fmt.Sprintf("[%s] %s", entry.keys, entry.text)))) + + if i < il { + builder.WriteString(" ") + } } - l := text.Len(builder.String()) - if l < maxX { - builder.WriteString(colors.White(colors.BlueBg(strings.Repeat(" ", maxX-l)))) + tl := text.Len(builder.String()) + if tl < maxX { + builder.WriteString(colors.White(colors.BlackBg(strings.Repeat(" ", maxX-tl)))) } return builder.String()