From 877c475aa6a7e42ca7477bb861921697e394d301 Mon Sep 17 00:00:00 2001 From: MuXiu1997 Date: Tue, 28 Feb 2023 07:59:40 +0800 Subject: [PATCH] feat: add `ctrl+@`(`ctrl+space`) keybinding for `choose` and `filter` (#276) * feat(filter): add ctrl+@ keybinding * feat(choose): add ctrl+@ keybinding --- choose/choose.go | 2 +- filter/filter.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/choose/choose.go b/choose/choose.go index 0e898fa..468dc04 100644 --- a/choose/choose.go +++ b/choose/choose.go @@ -116,7 +116,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.aborted = true m.quitting = true return m, tea.Quit - case " ", "tab", "x": + case " ", "tab", "x", "ctrl+@": if m.limit == 1 { break // no op } diff --git a/filter/filter.go b/filter/filter.go index dc688ce..9e5a4c1 100644 --- a/filter/filter.go +++ b/filter/filter.go @@ -163,6 +163,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } m.ToggleSelection() m.CursorUp() + case "ctrl+@": + if m.limit == 1 { + break // no op + } + m.ToggleSelection() default: m.textinput, cmd = m.textinput.Update(msg)