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
1 changed files with 1 additions and 1 deletions

2
fzf
View File

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