Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Defer `compdef` calls until after `compinit -i` is called

Conflicts:
	antigen.zsh
  • Loading branch information...
commit 5e23ab6fec6935fc10ae9b2242f1f73d56facd99 1 parent 08e0612
@wrboyce wrboyce authored sharat87 committed
Showing with 10 additions and 3 deletions.
  1. +10 −3 antigen.zsh
View
13 antigen.zsh
@@ -7,6 +7,10 @@
local _ANTIGEN_BUNDLE_RECORD=""
local _ANTIGEN_INSTALL_DIR="$(dirname $0)"
+# Used to defer compinit/compdef
+typeset -a __deferred_compdefs
+compdef () { __deferred_compdefs[$(($#__deferred_compdefs+1))]=$* }
+
# Syntaxes
# antigen-bundle <url> [<loc>=/]
# Keyword only arguments:
@@ -392,9 +396,12 @@ antigen-theme () {
antigen-apply () {
# Initialize completion.
- # TODO: Only load completions if there are any changes to the bundle
- # repositories.
- compinit -i
+ local cd
+ for cd in $__deferred_compdefs; do
+ compdef $cd
+ done
+ unset __deferred_compdefs
+ compdef _antigen antigen
}
antigen-list () {
Please sign in to comment.
Something went wrong with that request. Please try again.