aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mingling_core/tmpls/comps/zsh.zsh9
1 files changed, 6 insertions, 3 deletions
diff --git a/mingling_core/tmpls/comps/zsh.zsh b/mingling_core/tmpls/comps/zsh.zsh
index f665133..7cf5f7b 100644
--- a/mingling_core/tmpls/comps/zsh.zsh
+++ b/mingling_core/tmpls/comps/zsh.zsh
@@ -61,8 +61,11 @@ _<<<bin_name>>>_completion() {
fi
}
-compdef _<<<bin_name>>>_completion <<<bin_name>>>
-
-if [[ $? -ne 0 ]]; then
+if (( $+functions[compdef] )); then
+ compdef _<<<bin_name>>>_completion <<<bin_name>>>
+ if [[ $? -ne 0 ]]; then
+ compctl -K _<<<bin_name>>>_completion <<<bin_name>>>
+ fi
+else
compctl -K _<<<bin_name>>>_completion <<<bin_name>>>
fi