[New] `bash_completion`: Add support for `ZSH_DISABLE_COMPFIX` flag.

When using Oh My Zsh the ZSH_DISABLE_COMPFIX flag allows the zsh completion system to use files it deems to be insecure.
Nathan Burchill 2018-09-18 16:15:35 -04:00 committed by Jordan Harband
parent 2d97ce5f7b
commit 0c2efed407
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 5 additions and 1 deletions

View File

@ -85,7 +85,11 @@ __nvm() {
# ZSH, load and run bashcompinit before calling the complete function. # ZSH, load and run bashcompinit before calling the complete function.
if [[ -n ${ZSH_VERSION-} ]]; then if [[ -n ${ZSH_VERSION-} ]]; then
autoload -U +X bashcompinit && bashcompinit autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit autoload -U +X compinit && if [[ ${ZSH_DISABLE_COMPFIX-} = true ]]; then
compinit -u
else
compinit
fi
fi fi
complete -o default -F __nvm nvm complete -o default -F __nvm nvm