m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Do not sort the result if query is empty

This commit is contained in:
Junegunn Choi
2013-11-10 03:57:10 +09:00
parent ddf6e5ef1e
commit 8a0a3f9bf5

2
fzf
View File

@@ -429,7 +429,7 @@ searcher = Thread.new {
end end
mcount = matches.length mcount = matches.length
if @sort && mcount <= @sort if @sort && mcount <= @sort && !q.empty?
matches.replace matches.sort_by { |triple| matches.replace matches.sort_by { |triple|
line, b, e = triple line, b, e = triple
[b ? (e - b) : 0, line.length, line] [b ? (e - b) : 0, line.length, line]