Skip to content

Commit

Permalink
[Fix] bash_completion: move compinit before bashcompinit
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoshi123 authored and ljharb committed Dec 29, 2020
1 parent 6982dee commit f3fa157
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ __nvm() {
# called bashcompinit that will create a complete in ZSH. If the user is in
# ZSH, load and run bashcompinit before calling the complete function.
if [[ -n ${ZSH_VERSION-} ]]; then
autoload -U +X bashcompinit && bashcompinit
# Calling compinit first and then bashcompinit as mentioned by zsh man page.
autoload -U +X compinit && if [[ ${ZSH_DISABLE_COMPFIX-} = true ]]; then
compinit -u
else
compinit
fi
autoload -U +X bashcompinit && bashcompinit
fi

complete -o default -F __nvm nvm

0 comments on commit f3fa157

Please sign in to comment.