summaryrefslogtreecommitdiffstats
path: root/src/repl/completer.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2025-01-23 09:46:25 +0800
committerGitHub <noreply@github.com>2025-01-23 09:46:25 +0800
commit7567478754bfbc4b103b692c6b1574f80a8b453f (patch)
tree9cd9d2665710d26d1a0b957ac2d74dfd10dd0498 /src/repl/completer.rs
parent5defd0bdb0e68ca26da575c88116313cd48e290d (diff)
downloadaichat-7567478754bfbc4b103b692c6b1574f80a8b453f.tar.gz
refactor: sort repl autocompletion items by fuzzy-match score (#1119)
Diffstat (limited to 'src/repl/completer.rs')
-rw-r--r--src/repl/completer.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repl/completer.rs b/src/repl/completer.rs
index 12e871a..bcce694 100644
--- a/src/repl/completer.rs
+++ b/src/repl/completer.rs
@@ -45,7 +45,7 @@ impl Completer for ReplCompleter {
if line == "." {
return true;
}
- line.starts_with(&cmd.name[..2]) && fuzzy_match(cmd.name, &line)
+ line.starts_with(&cmd.name[..2]) && fuzzy_match(cmd.name, &line).is_some()
})
.collect();