From d3bb52d7d825f2a6ce2e1c76ca472b05c6f27b40 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 5 Jan 2022 09:10:32 +0100 Subject: style: declare globals properly By default, `typeset` defines variables locally unless in the main scope. This is specially bad when using `omz plugin load`, which happens inside a function, so the declared variables don't continue being defined when the function finishes and the main scope reappears. --- plugins/deno/deno.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/deno/deno.plugin.zsh') diff --git a/plugins/deno/deno.plugin.zsh b/plugins/deno/deno.plugin.zsh index 77c2125d2..6c12bae13 100644 --- a/plugins/deno/deno.plugin.zsh +++ b/plugins/deno/deno.plugin.zsh @@ -32,7 +32,7 @@ command mkdir -p "$ZSH_CACHE_DIR/completions" # If the completion file doesn't exist yet, we need to autoload it and # bind it to `deno`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_deno" ]]; then - declare -A _comps + typeset -g -A _comps autoload -Uz _deno _comps[deno]=_deno fi -- cgit v1.2.3-70-g09d2