mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-08-18 18:48:40 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user