-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Possibly use flx-make-filename-cache rather than flx-make-string-cache #2816
Labels
Comments
basil-conto
added a commit
to basil-conto/swiper
that referenced
this issue
Feb 27, 2021
* ivy.el: Avoid registering eval-after-load hooks or unconditionally loading flx at load time. (ivy--flx-featurep): Turn variable into "thunk" function that only tries loading flx once when actually needed. All uses changed. (ivy-flx-cache): New escape hatch variable affording users control over the default flx cache used. (ivy--flx-cache): Turn variable into function that chooses between types of flx cache subject to ivy--completing-fname-p and ivy-flx-cache. All uses changed. (ivy-flx-limit): Improve docstring style. (ivy-toggle-fuzzy): Quote function symbols as such. Fixes abo-abo#2816.
I've never used |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm coming to ivy from flx-ido and found that filename matching was very different and less useful. I finally discovered the reason for the difference. When calling
flx-score
, flx-ido usesflx-file-cache
, which is a filename cache defined in flx-ido.el. In ivy, the call toflx-score
usesivy--flx-cache
which is a string cache defined in ivy.el. The difference in behavior is pretty big. Changingivy--flx-cache
to a filename cache would probably be too disruptive to people already familiar with the existing behavior. Maybe it would be possible add an official way to switch to using a filename cache rather than a string cache? In my current configuration I include(setq ivy--flx-cache (flx-make-filename-cache))
after ivy is loaded and the flex matching now works like I'm used to.Here's an example of how matching is different. I have an sbt project with a source named something like "src/main/scala/org/fu/MySuperApp.scala". With a query of "ms" the string cache settles on the 'm' in main and the 's' in scala so all of my source code ends up with the same flx-score. The filename cache selects the 'M' and 'S' in the file name, which is a much more useful result.
The text was updated successfully, but these errors were encountered: