diff options
author | mikael <34864484+MikaelFangel@users.noreply.github.com> | 2023-03-07 22:59:37 +0100 |
---|---|---|
committer | Maas Lalani <maas@lalani.dev> | 2023-03-09 12:42:55 -0500 |
commit | 708a653eae20c3dbd5785741436a65e894d4f65c (patch) | |
tree | 0c3084f948d75f75812f1da75e84162175754c6e | |
parent | 2bda0014802e319c0aba180d47b50da12c63283c (diff) |
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.
-rw-r--r-- | filter/command.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/filter/command.go b/filter/command.go index 7f12e30..2a37d71 100644 --- a/filter/command.go +++ b/filter/command.go @@ -53,8 +53,13 @@ func (o Options) Run() error { var matches []fuzzy.Match if o.Value != "" { i.SetValue(o.Value) + } + switch { + case o.Value != "" && o.Fuzzy: matches = fuzzy.Find(o.Value, choices) - } else { + case o.Value != "" && !o.Fuzzy: + matches = exactMatches(o.Value, choices) + default: matches = matchAll(choices) } |