summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2013-11-16 00:31:22 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2013-11-16 00:31:22 +0900
commit76c7f4f9c0d1a28986f3f2f3cc30116a136681c4 (patch)
tree685cf9a83a836faa6ddd097be9a30911ddc507d1
parent8ae604af677272f13d286dc0899feb6276eec5ac (diff)
Do not include highlighted item when items chosen
-rwxr-xr-xfzf12
1 files changed, 7 insertions, 5 deletions
diff --git a/fzf b/fzf
index d226803a..14c2a125 100755
--- a/fzf
+++ b/fzf
@@ -10,7 +10,7 @@
# URL: https://github.com/junegunn/fzf
# Author: Junegunn Choi
# License: MIT
-# Last update: November 15, 2013
+# Last update: November 16, 2013
#
# Copyright (c) 2013 Junegunn Choi
#
@@ -677,11 +677,13 @@ class FZF
ensure
C.close_screen
if got
- @selects.delete got
- @selects.each do |sel, _|
- @stdout.puts sel
+ if @selects.empty?
+ @stdout.puts got
+ else
+ @selects.each do |sel, _|
+ @stdout.puts sel
+ end
end
- @stdout.puts got
end
end
end