Skip to content

Commit

Permalink
fix: use !isuppercase instead of lowercase in completion logic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pfitzseb committed Oct 17, 2022
1 parent 3595dfd commit 75188f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/requests/completions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 75188f8

Please sign in to comment.