Skip to content

Commit

Permalink
fix: filter
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Dec 3, 2024
1 parent 79b7784 commit f72d9ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion filter/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (o Options) Run() error {
fuzzy: o.Fuzzy,
timeout: o.Timeout,
hasTimeout: o.Timeout > 0,
sort: o.Sort,
sort: o.Sort && o.FuzzySort,
}, options...)

tm, err := p.Run()
Expand Down
5 changes: 4 additions & 1 deletion filter/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type Options struct {
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 by their scores when fuzzy matching, no effect otherwise" default:"true" env:"GUM_FILTER_SORT" 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 f72d9ac

Please sign in to comment.