From 218931d6ba6f33f023aa9dc921d0aa0aca5a9f12 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 24 Nov 2024 13:04:11 -0500 Subject: feat: add help at the bottom (#5) * Attemp at using goreleaser * Fix syntax error in .goreleaser.yml * fix: Check roadmap feature for clipboard (README) * feat: add help menu at the bottom (#4) * MVP for a help menu * fix: commented code is evil --- internal/picker/keys.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'internal/picker/keys.go') diff --git a/internal/picker/keys.go b/internal/picker/keys.go index f5b7135..26b7e80 100644 --- a/internal/picker/keys.go +++ b/internal/picker/keys.go @@ -10,7 +10,7 @@ func newKeybinds() keybinds { return keybinds{ next: key.NewBinding( key.WithKeys("j", "down"), - key.WithHelp("j", "previous slider"), + key.WithHelp("j", "prev. slider"), ), prev: key.NewBinding( key.WithKeys("k", "up"), @@ -24,6 +24,10 @@ func Keys() []key.Binding { return []key.Binding{k.next, k.prev} } -func (m Model) AllKeys() []key.Binding { - return append(Keys(), m.sliders[m.active].AllKeys()...) +func (m Model) AllKeys() [][]key.Binding { + keys := make([][]key.Binding, len(m.sliders[m.active].AllKeys())+1) + keys[0] = Keys() + copy(keys[1:], m.sliders[m.active].AllKeys()) + return keys + // return append(m.sliders[m.active].AllKeys(), Keys()) } -- cgit v1.2.3