Merge pull request #836 from epage/ident

fix(cli): Properly fallback to built-in ident dict
This commit is contained in:
Ed Page 2023-09-27 10:49:51 -05:00 committed by GitHub
commit 1a3ce2b924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -270,13 +270,12 @@ impl<'i, 'w, D: typos::Dictionary> typos::Dictionary for Override<'i, 'w, D> {
// Skip hashing if we can
if !self.identifiers.is_empty() {
self.identifiers
.get(ident.token())
.map(|c| c.borrow())
.or_else(|| self.inner.correct_ident(ident))
} else {
None
if let Some(status) = self.identifiers.get(ident.token()).map(|c| c.borrow()) {
return Some(status);
}
}
self.inner.correct_ident(ident)
}
fn correct_word<'s>(&'s self, word: typos::tokens::Word<'_>) -> Option<Status<'s>> {