Add FuzzyLongestSort flag

This commit is contained in:
Takumi Sueda 2023-03-08 23:31:49 +09:00
parent 3af95d6d07
commit 1e185a785f
2 changed files with 3 additions and 0 deletions

View file

@ -104,6 +104,7 @@ type Peco struct {
skipReadConfig bool
styles StyleSet
use256Color bool
fuzzyLongestSort bool
// Source is where we buffer input. It gets reused when a new query is
// executed.
@ -299,6 +300,7 @@ type Config struct {
QueryExecutionDelay int
StickySelection bool
MaxScanBufferSize int
FuzzyLongestSort bool
// If this is true, then the prefix for single key jump mode
// is displayed by default.

View file

@ -568,6 +568,7 @@ func (p *Peco) ApplyConfig(opts CLIOptions) error {
if len(p.initialFilter) <= 0 {
p.initialFilter = opts.OptInitialMatcher
}
p.fuzzyLongestSort = p.config.FuzzyLongestSort
if err := p.populateFilters(); err != nil {
return errors.Wrap(err, "failed to populate filters")