summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-06-15 18:35:47 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-06-15 18:35:47 +0900
commit61ba8d5a11fc1672d1601ae246817f9b3eb29404 (patch)
tree4411041c113453090dd4220548d0c861fdaf2576
parent4a3a5ee70daeca7c9d361ef92bf77305e1927211 (diff)
Add a small delay when search is interrupted0.8.5
Search is interrupted when the query string has changed. This frequently happens when the user is actively typing in a query. This (rather arbitrary) delay is introduced not to start the next search immediately, which is likely to be interrupted as well. The result of it is that fzf feels more responsive.
-rwxr-xr-xfzf7
1 files changed, 5 insertions, 2 deletions
diff --git a/fzf b/fzf
index f51ea057..4adda6d9 100755
--- a/fzf
+++ b/fzf
@@ -7,7 +7,7 @@
# / __/ / /_/ __/
# /_/ /___/_/ Fuzzy finder for your shell
#
-# Version: 0.8.5 (Jun 14, 2014)
+# Version: 0.8.5 (Jun 15, 2014)
#
# Author: Junegunn Choi
# URL: https://github.com/junegunn/fzf
@@ -629,7 +629,10 @@ class FZF
found.concat(q.empty? ? list :
matcher.match(list, q, q[0, cx], q[cx..-1]))
end
- next if skip
+ if skip
+ sleep 0.1
+ next
+ end
matches = @sort ? found : found.reverse
if !empty && @sort && matches.length <= @sort
matches = FZF.sort(matches)