Skip to content

Commit

Permalink
Fix deferred compdef between sourcing antigen and antigen apply
Browse files Browse the repository at this point in the history
Using some obscure Zsh syntax, check https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parameter-Expansion-Flags for documentation about it.

Fixes zsh-users#736
  • Loading branch information
segevfiner authored Apr 5, 2022
1 parent 64de2dc commit 60f73fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/antigen.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi

# Used to defer compinit/compdef
typeset -a __deferred_compdefs
compdef () { __deferred_compdefs=($__deferred_compdefs "$*") }
compdef () { __deferred_compdefs=($__deferred_compdefs "${${(@q-)@}}") }

# A syntax sugar to avoid the `-` when calling antigen commands. With this
# function, you can write `antigen-bundle` as `antigen bundle` and so on.
Expand Down Expand Up @@ -799,7 +799,7 @@ antigen-apply () {
# Apply all `compinit`s that have been deferred.
local cdef
for cdef in "${__deferred_compdefs[@]}"; do
compdef "$cdef"
compdef ${(Q)${(z)cdef}}
done

{ zcompile "$ANTIGEN_COMPDUMP" } &!
Expand Down

0 comments on commit 60f73fa

Please sign in to comment.