summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-12-01 13:08:55 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-12-01 13:08:55 +0900
commitc20954f020a16d6c013b59a894dead4cbfb52a83 (patch)
tree41ce3f363a8932526e9c4da17ba8754ba6bf9e0c /test
parent1e8e1d3c9deaf3abdcf42ab5b63927b9eac4a98c (diff)
Add replace-query action
replace-query action replaces the query string with the current selection. If the selection is too long, it will be truncated. If the line contains meta-characters of fzf search syntax, it is possible that the line is no longer included in the updated result. e.g. echo '!hello' | fzf --bind ctrl-v:replace-query Close #1137
Diffstat (limited to 'test')
-rw-r--r--test/test_go.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 111595ea..eca458ca 100644
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -769,6 +769,15 @@ class TestGoFZF < TestBase
assert_equal %w[print-my-query], readonce.split($INPUT_RECORD_SEPARATOR)
end
+ def test_bind_replace_query
+ tmux.send_keys "seq 1 1000 | #{fzf '--print-query --bind=ctrl-j:replace-query'}", :Enter
+ tmux.send_keys '1'
+ tmux.until { |lines| lines[-2].end_with? '272/1000' }
+ tmux.send_keys 'C-k', 'C-j'
+ tmux.until { |lines| lines[-2].end_with? '29/1000' }
+ tmux.until { |lines| lines[-1].end_with? '> 10' }
+ end
+
def test_long_line
data = '.' * 256 * 1024
File.open(tempname, 'w') do |f|