diff --git a/choose/choose.go b/choose/choose.go index c7d13a636..e4d6778f9 100644 --- a/choose/choose.go +++ b/choose/choose.go @@ -51,6 +51,7 @@ func defaultKeymap() keymap { ToggleAll: key.NewBinding( key.WithKeys("a", "A", "ctrl+a"), key.WithHelp("ctrl+a", "select all"), + key.WithDisabled(), ), Toggle: key.NewBinding( key.WithKeys(" ", "tab", "x", "ctrl+@"), diff --git a/choose/command.go b/choose/command.go index 395a3e455..078485983 100644 --- a/choose/command.go +++ b/choose/command.go @@ -93,6 +93,12 @@ func (o Options) Run() error { pager.InactiveDot = verySubduedStyle.Render("•") pager.KeyMap = paginator.KeyMap{} pager.Page = startingIndex / o.Height + + km := defaultKeymap() + if o.NoLimit { + km.ToggleAll.SetEnabled(true) + } + // Disable Keybindings since we will control it ourselves. tm, err := tea.NewProgram(model{ index: startingIndex, @@ -115,7 +121,7 @@ func (o Options) Run() error { timeout: o.Timeout, showHelp: o.ShowHelp, help: help.New(), - keymap: defaultKeymap(), + keymap: km, }, tea.WithOutput(os.Stderr)).Run() if err != nil { return fmt.Errorf("failed to start tea program: %w", err)