m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 15:53:39 -05:00

[shell] Add FZF_CTRL_T_COMMAND for CTRL-T

Close #40
This commit is contained in:
Junegunn Choi
2015-06-26 01:00:58 +09:00
parent 14e3b84073
commit 938151a834
5 changed files with 35 additions and 9 deletions

View File

@@ -148,6 +148,7 @@ class TestBase < Minitest::Test
def setup
ENV.delete 'FZF_DEFAULT_OPTS'
ENV.delete 'FZF_CTRL_T_COMMAND'
ENV.delete 'FZF_DEFAULT_COMMAND'
end
@@ -651,6 +652,12 @@ module TestShell
@tmux.kill
end
def set_var name, val
tmux.prepare
tmux.send_keys "export #{name}='#{val}'", :Enter
tmux.prepare
end
def test_ctrl_t
tmux.prepare
tmux.send_keys 'C-t', pane: 0
@@ -670,6 +677,14 @@ module TestShell
tmux.send_keys 'C-c', 'C-d'
end
def test_ctrl_t_command
set_var "FZF_CTRL_T_COMMAND", "seq 100"
tmux.send_keys 'C-t', pane: 0
lines = tmux.until(1) { |lines| lines.item_count == 100 }
tmux.send_keys :BTab, :BTab, :BTab, :Enter, pane: 1
tmux.until(0) { |lines| lines[-1].include? '1 2 3' }
end
def test_alt_c
tmux.prepare
tmux.send_keys :Escape, :c, pane: 0
@@ -842,6 +857,12 @@ class TestFish < TestBase
tmux.until { |lines| lines.empty? }
end
def set_var name, val
tmux.prepare
tmux.send_keys "set -l #{name} '#{val}'", :Enter
tmux.prepare
end
def setup
super
@tmux = Tmux.new :fish