refactor(plugins): generate completion functions in the background

This commit is contained in:
Marc Cornellà 2021-12-28 14:30:13 +01:00
commit 49bae43f62
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B
5 changed files with 57 additions and 62 deletions

View file

@ -7,7 +7,7 @@ print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"
# Remove old generated completion file
command rm -f "${0:A:h}/_rustup"
command rm -f "${0:A:h}/_rustup" "$ZSH_CACHE_DIR/rustup_version"
(( ${fpath[(Ie)$ZSH/plugins/rust]} )) || {
fpath=("$ZSH/plugins/rust" $fpath)