summaryrefslogtreecommitdiff
path: root/plugins/helm
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2022-02-19 17:12:23 -0600
committerTuowen Zhao <ztuowen@gmail.com>2022-02-19 17:12:23 -0600
commitcae9a2b797649379e865e6bd73bc67e294e4ac77 (patch)
tree481419eff4bc761c3ca516704427394193473419 /plugins/helm
parent49edbf438ed690c76e6b2af80368c59404cf0167 (diff)
parent3427da4057dbe302933a7b5b19b4e23bfb9d0969 (diff)
downloadzsh-cae9a2b797649379e865e6bd73bc67e294e4ac77.tar.gz
zsh-cae9a2b797649379e865e6bd73bc67e294e4ac77.tar.bz2
zsh-cae9a2b797649379e865e6bd73bc67e294e4ac77.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/helm')
-rw-r--r--plugins/helm/helm.plugin.zsh14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/helm/helm.plugin.zsh b/plugins/helm/helm.plugin.zsh
index 472c1c9dd..cadfa551a 100644
--- a/plugins/helm/helm.plugin.zsh
+++ b/plugins/helm/helm.plugin.zsh
@@ -11,12 +11,12 @@ command rm -f "${ZSH_CACHE_DIR}/helm_completion"
command mkdir -p "$ZSH_CACHE_DIR/completions"
(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
-# If the completion file doesn't exist yet, we need to autoload it and
-# bind it to `helm`. Otherwise, compinit will have already done that.
+# If the completion file does not exist, generate it and then source it
+# Otherwise, source it and regenerate in the background
if [[ ! -f "$ZSH_CACHE_DIR/completions/_helm" ]]; then
- declare -A _comps
- autoload -Uz _helm
- _comps[helm]=_helm
+ helm completion zsh >| "$ZSH_CACHE_DIR/completions/_helm"
+ source "$ZSH_CACHE_DIR/completions/_helm"
+else
+ source "$ZSH_CACHE_DIR/completions/_helm"
+ helm completion zsh >| "$ZSH_CACHE_DIR/completions/_helm" &|
fi
-
-helm completion zsh >| "$ZSH_CACHE_DIR/completions/_helm" &|