summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-12-03 03:06:10 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-12-03 23:32:41 +0900
commitd6588fc835aff6d952d86b1bdc5ed7378a846ab9 (patch)
tree1c40ac98d49880bd395292d8d29e7bab24ca0017 /test
parent5a7b41a2cf1271537c9831b0fddd38dbe58eb60d (diff)
[bash-completion] Fix custom completion with dynamic loader enabled
After _completion_loader is called, instead of loading the entire completion.bash file, just restore the fzf completion for the current command. `_fzf_orig_completion_$cmd` is only set if _completion_loader actually changed the completion options to avoid infinite loop. Close #1170
Diffstat (limited to 'test')
-rw-r--r--test/test_go.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 03fee238..4612584a 100644
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -1761,6 +1761,27 @@ class TestBash < TestBase
super
@tmux = Tmux.new :bash
end
+
+ def test_dynamic_completion_loader
+ tmux.paste 'touch /tmp/foo; _fzf_completion_loader=1'
+ tmux.paste '_completion_loader() { complete -o default fake; }'
+ tmux.paste 'complete -F _fzf_path_completion -o default -o bashdefault fake'
+ tmux.send_keys 'fake /tmp/foo**', :Tab
+ tmux.until do |lines|
+ lines.item_count.positive? && lines.item_count == lines.match_count
+ end
+ tmux.send_keys 'C-c'
+
+ tmux.prepare
+ tmux.send_keys 'fake /tmp/foo'
+ tmux.send_keys :Tab , 'C-u'
+
+ tmux.prepare
+ tmux.send_keys 'fake /tmp/foo**', :Tab
+ tmux.until do |lines|
+ lines.item_count.positive? && lines.item_count == lines.match_count
+ end
+ end
end
class TestZsh < TestBase