summaryrefslogtreecommitdiff
path: root/internal/picker/keys.go
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 13:04:11 -0500
committerGitHub <noreply@github.com>2024-11-24 13:04:11 -0500
commit218931d6ba6f33f023aa9dc921d0aa0aca5a9f12 (patch)
tree92089835c75f36318c81253d67cf89b18b75f774 /internal/picker/keys.go
parentef65550765215416195ad1a456408db781e752fd (diff)
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
Diffstat (limited to 'internal/picker/keys.go')
-rw-r--r--internal/picker/keys.go10
1 files changed, 7 insertions, 3 deletions
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())
}