fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 6959e7cd2225c545058d64ec47a6a876c8e41693 parent 0480cad800f3dd2aa5aea1c5d7392d847636a7a6 Author: John Hawthorn <john.hawthorn@gmail.com> Date: Sat, 26 Jul 2014 23:05:46 -0700 No need anymore for strlen to break ties Diffstat:
| M | fzy.c | | | 8 | +------- |
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/fzy.c b/fzy.c @@ -63,13 +63,7 @@ static int cmpchoice(const void *p1, const void *p2) { double score1 = choices_score[idx1]; double score2 = choices_score[idx2]; - if(score1 == score2) - /* break ties by length of result */ - return strlen(choices[idx1]) - strlen(choices[idx2]); - else if(score1 < score2) - return 1; - else - return -1; + return score1 - score2; } void run_search(char *needle){