From 6e96fffb3d8bec5384118f3dedc499d164384ca5 Mon Sep 17 00:00:00 2001 From: zeudev Date: Wed, 18 Sep 2024 10:37:16 -0700 Subject: [PATCH] feat: shortcut to skip rest of emails for `pizza generate config` (#197) * add skip rest key shortcut * formatted * Update cmd/generate/config/spec.go Co-authored-by: John McBride --------- Co-authored-by: John McBride --- cmd/generate/config/spec.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/generate/config/spec.go b/cmd/generate/config/spec.go index 5284cc9..9fa67ce 100644 --- a/cmd/generate/config/spec.go +++ b/cmd/generate/config/spec.go @@ -32,6 +32,7 @@ func (k keymap) ShortHelp() []key.Binding { key.NewBinding(key.WithKeys("ctrl+n"), key.WithHelp("ctrl+n", "next suggestion")), key.NewBinding(key.WithKeys("ctrl+p"), key.WithHelp("ctrl+p", "prev suggestion")), key.NewBinding(key.WithKeys("ctrl+i"), key.WithHelp("ctrl+i", "ignore email")), + key.NewBinding(key.WithKeys("ctrl+s"), key.WithHelp("ctrl+s", "skip the rest")), key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "quit")), key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "submit")), } @@ -88,6 +89,9 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } return m, nil + case tea.KeyCtrlS: + return m, runOutputGeneration(m.opts, m.attributionMap) + case tea.KeyEnter: if len(strings.Trim(m.textInput.Value(), " ")) == 0 { return m, nil