Skip to content

Commit

Permalink
Merge branch 'main' into fix-filter-no-strict
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Dec 4, 2024
2 parents 8908e64 + c422e76 commit 20fcdc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions filter/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ func (o Options) Run() error {
fuzzy: o.Fuzzy,
timeout: o.Timeout,
hasTimeout: o.Timeout > 0,
sort: o.Sort,
strict: o.Strict,
sort: o.Sort && o.FuzzySort,
strict: o.Strict,
}, options...)

tm, err := p.Run()
Expand Down
7 changes: 5 additions & 2 deletions filter/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ type Options struct {
Height int `help:"Input height" default:"0" env:"GUM_FILTER_HEIGHT"`
Value string `help:"Initial filter value" default:"" env:"GUM_FILTER_VALUE"`
Reverse bool `help:"Display from the bottom of the screen" env:"GUM_FILTER_REVERSE"`
Fuzzy bool `help:"Enable fuzzy matching" default:"true" env:"GUM_FILTER_FUZZY" negatable:""`
Sort bool `help:"Sort the results" default:"true" env:"GUM_FILTER_SORT" negatable:""`
Fuzzy bool `help:"Enable fuzzy matching; otherwise match from start of word" default:"true" env:"GUM_FILTER_FUZZY" negatable:""`
FuzzySort bool `help:"Sort fuzzy results by their scores" default:"true" env:"GUM_FILTER_FUZZY_SORT" negatable:""`
Timeout time.Duration `help:"Timeout until filter command aborts" default:"0s" env:"GUM_FILTER_TIMEOUT"`

// Deprecated: use [FuzzySort]. This will be removed at some point.
Sort bool `help:"Sort fuzzy results by their scores" default:"true" env:"GUM_FILTER_FUZZY_SORT" negatable:"" hidden:""`
}

0 comments on commit 20fcdc7

Please sign in to comment.