summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2013-11-10 03:57:10 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2013-11-10 03:57:10 +0900
commit8a0a3f9bf552ce4d6970048f9d4c70222679de58 (patch)
treed3b032ba1515a691ac0f42785b0e9bb2f4b44399
parentddf6e5ef1e55ae29cce1ab13c509581cb04c36a8 (diff)
Do not sort the result if query is empty
-rwxr-xr-xfzf2
1 files changed, 1 insertions, 1 deletions
diff --git a/fzf b/fzf
index 13355e86..60bfdaa4 100755
--- a/fzf
+++ b/fzf
@@ -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]