From 708a653eae20c3dbd5785741436a65e894d4f65c Mon Sep 17 00:00:00 2001 From: mikael <34864484+MikaelFangel@users.noreply.github.com> Date: Tue, 7 Mar 2023 22:59:37 +0100 Subject: [PATCH] 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. --- filter/command.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) }