The .match() method now returns an array of string indexes for each matched char. This allows the code to follow scorer almost exactly and simplifies the logic in fuzzy-finder.
It does have one issue. Since scorer will double-count characters, a search for rc against src/scorer.coffee will result in s[r][c]/sco[r]er.[c]offee. See screenshot:
This "feature" can be removed by simplifying the unless queryHasSlashes code in fuzzaldrin.coffee to either:
return the baseMatches if all the characters match, or
return the full path matches if baseMatches is empty
The
.match()
method now returns an array of string indexes for each matched char. This allows the code to follow scorer almost exactly and simplifies the logic infuzzy-finder
.It does have one issue. Since scorer will double-count characters, a search for
rc
againstsrc/scorer.coffee
will result ins[r][c]/sco[r]er.[c]offee
. See screenshot:This "feature" can be removed by simplifying the
unless queryHasSlashes
code infuzzaldrin.coffee
to either:baseMatches
if all the characters match, ormatches
ifbaseMatches
is emptyThe corresponding https://github.com/atom/fuzzy-finder/pull/39 has been updated to use this code.