This commit is contained in:
Oliver Tzeng 2023-02-02 22:43:12 +08:00
parent c3588b695e
commit e1e013cd3d
2 changed files with 2 additions and 2 deletions

View file

@ -136,7 +136,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Then we select the item that they have pressed enter on. If they
// have selected items, then we simply return them.
if m.numSelected < 1 {
if o.AllowUnchoosen == false {
if o.AllowUnchosen == false {
m.items[m.index].selected = true
}
}

View file

@ -8,7 +8,7 @@ type Options struct {
Limit int `help:"Maximum number of options to pick" default:"1" group:"Selection"`
NoLimit bool `help:"Pick unlimited number of options (ignores limit)" group:"Selection"`
AllowUnchoosen bool `help:"Allow gum choose to proceed when pressing enter without selecting anything" group:"Selection"`
AllowUnchosen bool `help:"Allow gum choose to proceed when pressing enter without selecting anything" group:"Selection"`
Ordered bool `help:"Maintain the order of the selected options" env:"GUM_CHOOSE_ORDERED"`
Height int `help:"Height of the list" default:"10" env:"GUM_CHOOSE_HEIGHT"`
Cursor string `help:"Prefix to show on item that corresponds to the cursor position" default:"> " env:"GUM_CHOOSE_CURSOR"`