-
Notifications
You must be signed in to change notification settings - Fork 37
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
Recency not given any weightage #70
Comments
Can you give a more complete list and demo steps? Why not type "g"? The idea of flx is to smartly sort based on letters as On Sun, Mar 1, 2015 at 6:05 PM, Ramkumar Ramachandra <
Le |
Sorry for the terrible bug report; hopefully, this is a better one. So, suppose I have a directory with these files:
If they have corresponding open buffers, and I Compare this experience with plain ido: I get the candidates To summarize, my main problem with flx is not being able to quickly select what I can see: when I type in something to filter, the whole candidate list changes, and I don't know what I was looking for anymore. |
Let me know what you think of this idea: The index of each item in the initial choices list could be used to set an initial score for each item that would reflect recency for commands that support that and other sorting for commands that have that. At first I thought of just assigning an integer (- flx-ido-threshold index) but one problem with that is that for long lists that would overwelm all other scoring. So I though instead we could use a decimal, so that the sorting would only matter if the candidates had otherwise equal scores, and a multiple could be used if one wanted to increase the influence of initial sorting. I think candidates are most likely to have equal scores on common prefix matches or with only a few characters of fuzzy matching. It would look something like this:
Perhaps one would want sorting to be more relevant, and have it take priority over minor scoring differences. One could increase the multiple like this:
I don't know what the performance or memory impact switching from an integer to float for the score might have. |
On second thought maybe flx-ido-threshold wouldn't be used. I don't know when the initial score should be set, whether it would happen on the initial list or only after the first character was inputted. I also don't know how available and efficient the index and choices list length are when the scores are being first calculated. |
I definitely feel like a recency weight would be helpful. Recency could be thrown into Right, now I'm thinking of |
I'm starting to lean on summing |
I think there is a bug here unrelated to the score. To reproduce, create the files aaa1, aaa2, aaa3, aaa4, aaa5 and then use ido-find-file. In the unfiltered list they are sorted one way, but when you press "a" they are suddenly sorted in reverse. I checked the scores, they are all identical. |
lewang#70 To reproduce, create the files aaa1, aaa2, aaa3, aaa4, aaa5 and then use ido-find-file. In the unfiltered list they are sorted one way, but when you press "a" they are suddenly sorted in reverse.
I have found a fix for the problem from my previous comment (patch: martinxyz@35b90358). But I was groping in the dark, changing sorting orders in until it worked, without understanding the original intent, so it may not be the best fix. It should at least partially fix the original report. For actually sorting files by "recency" I use my own file list hooks: https://github.com/martinxyz/config/blob/574ffb/elisp/emacs.el#L560 (read the emacs wiki link too before you use it, it has different variants of that code). |
After a bit more testing, while my patch seems to fix ido-find-file it breaks ido-switch-buffer... that's what you get for hacking blindly, I guess. |
lewang#70 This fixes the problem that ido-switch-buffer would not work any more after my previous change (it did always narrow down to a single choice).
So, suppose I have the list of candidates:
The second I type
.
with the intent of selecting.gdbinit
, the entire match list is repopulated with lots of irrelevant entries.This makes flx unusable for me, and I think fixing it is just a matter of giving recency a weight?
The text was updated successfully, but these errors were encountered: