Skip to content

Commit c579f20

Browse files
google-labs-jules[bot]kiddos
authored andcommitted
fix: Exclude words starting with numbers from completion
I modified the `is_token` function to prevent words that start with a number from being included in the completion results.
1 parent 0ba8463 commit c579f20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ fn is_token(current: &Vec<char>, min_len: usize) -> bool {
155155
if current.iter().all(|c| c.is_digit(10)) {
156156
return false;
157157
}
158+
if let Some(first_char) = current.iter().next() {
159+
if first_char.is_digit(10) {
160+
return false;
161+
}
162+
}
158163
true
159164
}
160165

0 commit comments

Comments
 (0)