Making fuzzy-finder use the right algorithm

This commit is contained in:
Maurício Szabo 2023-11-23 19:38:44 -03:00
parent a4b48d843f
commit 4264de019b

View File

@ -83,7 +83,7 @@ module.exports = class FuzzyFinderView {
);
const items = this.nativeFuzzyForResults.match(
filterQuery,
{maxResults: 1, recordMatchIndexes: true}
{maxResults: 1, recordMatchIndexes: true, algorithm: 'command-t'}
)
const matches = items.length ? items[0].matchIndexes : []
const repository = repositoryForPath(filePath)
@ -338,7 +338,7 @@ module.exports = class FuzzyFinderView {
filterFn(items, query) {
if (!query) return items
return this.nativeFuzzy.match(query, {maxResults: MAX_RESULTS})
return this.nativeFuzzy.match(query, {maxResults: MAX_RESULTS, algorithm: 'command-t'})
.map(({id}) => this.items[id])
}
}