From 6c847071dd48244ccadb413a56ee78a3cd438437 Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Mon, 17 Oct 2022 14:50:51 +0200 Subject: [PATCH] fix: use !isuppercase instead of islowercase in completion logic we're not really interested in whether all chars are lowercase (which is only true for letters); instead we want to determine whether the user manually upper-cased any chars and treat that as a signal that they care about the casing. --- src/requests/completions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/requests/completions.jl b/src/requests/completions.jl index ee264ca9..6ca1f5e0 100644 --- a/src/requests/completions.jl +++ b/src/requests/completions.jl @@ -30,7 +30,7 @@ using REPL Returns true if `s` starts with `prefix` or has a sufficiently high fuzzy score. """ function is_completion_match(s::AbstractString, prefix::AbstractString, cutoff=3) - starter = if all(islowercase, prefix) + starter = if !any(isuppercase, prefix) startswith(lowercase(s), prefix) else startswith(s, prefix)