From e6a0caf27a6363899ebbc50e113c52e50928cab6 Mon Sep 17 00:00:00 2001 From: Kevin Menard Date: Mon, 18 May 2015 22:30:37 -0400 Subject: [PATCH 1/2] Add an example completion file. --- custom/plugins/example/completions/example.fish | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 custom/plugins/example/completions/example.fish diff --git a/custom/plugins/example/completions/example.fish b/custom/plugins/example/completions/example.fish new file mode 100644 index 0000000..9733505 --- /dev/null +++ b/custom/plugins/example/completions/example.fish @@ -0,0 +1,2 @@ +# Optionally add completions for your plugin here. +# complete -f -c my_command -a some_arg -d 'Description here' From a06a58fc703c46d7e5baa617482c82f6961f52f2 Mon Sep 17 00:00:00 2001 From: Kevin Menard Date: Mon, 18 May 2015 22:32:42 -0400 Subject: [PATCH 2/2] Fix loading of custom plugin completions. --- functions/import.fish | 1 + spec/import.spec.fish | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/functions/import.fish b/functions/import.fish index 22f0853..05bc1db 100644 --- a/functions/import.fish +++ b/functions/import.fish @@ -38,6 +38,7 @@ function import -d "Load libraries, plugins, themes, etc." _prepend_tree $fish_path/$library $skip_spec _prepend_tree $fish_custom/$library $skip_spec _prepend_path $fish_path/$library/completions -d fish_complete_path + _prepend_path $fish_custom/$library/completions -d fish_complete_path # Set path to load files. set -l path $library/(basename $library).load diff --git a/spec/import.spec.fish b/spec/import.spec.fish index 12eb119..06d0fa2 100644 --- a/spec/import.spec.fish +++ b/spec/import.spec.fish @@ -37,6 +37,11 @@ function describe_import import plugins/git-flow expect $fish_complete_path --to-contain-all $fish_path/plugins/git-flow/completions end + + function it_adds_completion_files_for_custom_plugins_to_completion_path + import plugins/example + expect $fish_complete_path --to-contain-all $fish_custom/plugins/example/completions + end end spec.run $argv