Skip to content

Commit

Permalink
Use filterText when filtering internally
Browse files Browse the repository at this point in the history
See #829.
  • Loading branch information
pfoerster committed Dec 17, 2022
1 parent 85cded5 commit ef6a3f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/completion/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ impl<'db> CompletionBuilder<'db> {
entry: &bibtex::Entry,
) -> Option<()> {
let key = entry.name_token()?.to_string();
let score = self.matcher.fuzzy_match(&key, &self.text_pattern)?;

let category = LANGUAGE_DATA
.find_entry_type(&entry.type_token()?.text()[1..])
Expand All @@ -192,6 +191,8 @@ impl<'db> CompletionBuilder<'db> {
.trim(),
);

let score = self.matcher.fuzzy_match(&filter_text, &self.text_pattern)?;

let data = Data::Citation {
document,
key,
Expand Down Expand Up @@ -364,7 +365,7 @@ impl<'db> CompletionBuilder<'db> {
footer: Option<String>,
text: String,
) -> Option<()> {
let score = self.matcher.fuzzy_match(&name, &self.text_pattern)?;
let score = self.matcher.fuzzy_match(&text, &self.text_pattern)?;
self.items.push(Item {
range,
data: Data::Label {
Expand Down

0 comments on commit ef6a3f3

Please sign in to comment.