diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2014-02-02 21:41:08 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2014-02-02 21:41:08 +0900 |
commit | 089691faaf9a470847dc4c06824b8f7b219da195 (patch) | |
tree | a27db4f88a686cd89dbc62cea949e2ccdeda8cd8 | |
parent | 301290663d69dd451d18237c98f6bb7ed19d1834 (diff) |
Cache the result as sorted
-rwxr-xr-x | fzf | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -642,11 +642,11 @@ class FZF matcher.match(list, q, q[0, cx], q[cx..-1])) end next if skip - matches = fcache[q] = @sort ? found : found.reverse - end - - if !empty && @sort && matches.length <= @sort - matches = sort_by_rank(matches) + matches = @sort ? found : found.reverse + if !empty && @sort && matches.length <= @sort + matches = sort_by_rank(matches) + end + fcache[q] = matches end # Atomic update |