mirror of
https://github.com/charmbracelet/gum.git
synced 2024-09-11 14:35:30 +03:00
Fix for using --value in combination w/ --no-fuzzy
This add a check if the no fuzzy flag is set together with the --no-fuzzy flag.
This commit is contained in:
parent
2bda001480
commit
708a653eae
@ -53,8 +53,13 @@ func (o Options) Run() error {
|
|||||||
var matches []fuzzy.Match
|
var matches []fuzzy.Match
|
||||||
if o.Value != "" {
|
if o.Value != "" {
|
||||||
i.SetValue(o.Value)
|
i.SetValue(o.Value)
|
||||||
|
}
|
||||||
|
switch {
|
||||||
|
case o.Value != "" && o.Fuzzy:
|
||||||
matches = fuzzy.Find(o.Value, choices)
|
matches = fuzzy.Find(o.Value, choices)
|
||||||
} else {
|
case o.Value != "" && !o.Fuzzy:
|
||||||
|
matches = exactMatches(o.Value, choices)
|
||||||
|
default:
|
||||||
matches = matchAll(choices)
|
matches = matchAll(choices)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user