Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer shorter matches #86

Closed
fommil opened this issue Feb 25, 2016 · 2 comments
Closed

prefer shorter matches #86

fommil opened this issue Feb 25, 2016 · 2 comments

Comments

@fommil
Copy link

fommil commented Feb 25, 2016

I've been noticing that flx prefers longer names over shorter names, even if the shorter name is an exact match:

(flx-score "fake.scala" "fake")  ;; (296 0 1 2 3)
(flx-score "FakeSpec.scala" "fake") ;; (296 0 1 2 3)

for some reason the longer one shows up first in my projectile-find-file which is using flx-ido.

Is there any way you could order things by score and then length (shortest first), that'd be ace.

@lewang
Copy link
Owner

lewang commented Feb 26, 2016

It's not the length of the string that the algorithm cares about, but index
of the matching word that occurs in the string. Always sorting can be
expensive for large collections and you can get the result you want by
simply continuing to type the next character - ".".

Generally speaking, when working with flx, if the order isn't what you
expected, you can just keep typing a few more characters to get it right.

On Thu, Feb 25, 2016 at 4:02 PM, Sam Halliday notifications@github.com
wrote:

I've been noticing that flx prefers longer names over shorter names, even
if the shorter name is an exact match:

(flx-score "fake.scala" "fake") ;; (296 0 1 2 3)
(flx-score "FakeSpec.scala" "fake") ;; (296 0 1 2 3)

and for some reason the longer one shows up first in my
projectile-find-file which is using flx-ido.

Is there any way you could order things by score and then length (shortest
first), that'd be ace.


Reply to this email directly or view it on GitHub
#86.

Le

@fommil
Copy link
Author

fommil commented Feb 26, 2016

ok, I can live with that. Thanks for the response.

@fommil fommil closed this as completed Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants