Skip to content

Commit adf6279

Browse files
gitcoder89431claude
andcommitted
fix: restore dynamic //// fill in Help section headers
buildLines() now takes width and computes the slash fill correctly. Width=0 used at construction time (line counting only, fill irrelevant). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 13d9a67 commit adf6279

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

internal/screens/help.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Help struct {
1818

1919
func NewHelp(bindings [][]key.Binding, t theme.Theme) Help {
2020
h := Help{bindings: bindings, theme: t}
21-
h.totalLines = len(h.buildLines())
21+
h.totalLines = len(h.buildLines(0)) // width=0 for counting only
2222
return h
2323
}
2424

@@ -42,7 +42,7 @@ func (h Help) Update(msg tea.Msg) (Screen, tea.Cmd) {
4242
}
4343

4444
func (h Help) View(width, height int) string {
45-
lines := h.buildLines()
45+
lines := h.buildLines(width)
4646
total := len(lines)
4747

4848
if total <= height {
@@ -68,9 +68,12 @@ func (h Help) View(width, height int) string {
6868
}
6969

7070
// buildLines returns the full list of rendered lines for the Help screen.
71-
func (h Help) buildLines() []string {
71+
// Pass the actual width for rendering; pass 0 when only counting lines.
72+
func (h Help) buildLines(width int) []string {
7273
rule := func(label string) string {
73-
return h.theme.Title.Render(label) + h.theme.PaletteAccent.Render(" ////")
74+
labelW := lipgloss.Width(label)
75+
fill := strings.Repeat("/", max(0, width-labelW-1))
76+
return h.theme.Title.Render(label) + h.theme.PaletteAccent.Render(" "+fill)
7477
}
7578
bind := func(k, desc string) string {
7679
return " " + h.theme.Accent.Render(k) + " " + h.theme.Muted.Render(desc)

0 commit comments

Comments
 (0)