zplugin,autoload: Support LOADED_PLUGINS defined by Zsh plugin standard

This commit is contained in:
Sebastian Gniazdowski 2018-05-05 09:41:22 +02:00
parent 780b024935
commit 5d5e376cda
2 changed files with 5 additions and 0 deletions

View file

@ -1055,6 +1055,7 @@ ZPLGM[EXTENDED_GLOB]=""
else
(( quiet )) || print "Unregistering plugin $uspl2col"
-zplg-unregister-plugin "$user" "$plugin"
LOADED_PLUGINS[${LOADED_PLUGINS[(i)$user/$plugin]}]=() # Support Zsh plugin standard
-zplg-clear-report-for "$user" "$plugin"
(( quiet )) || print "Plugin's report saved to \$LASTREPORT"
fi

View file

@ -6,6 +6,7 @@
#
typeset -gaH ZPLG_REGISTERED_PLUGINS ZPLG_TASKS ZPLG_RUN
typeset -ga LOADED_PLUGINS
ZPLG_TASKS=( "<no-data>" )
# Snippets loaded, url -> file name
typeset -gAH ZPLGM ZPLG_REGISTERED_STATES ZPLG_SNIPPETS ZPLG_REPORTS ZPLG_ICE ZPLG_SICE
@ -938,6 +939,9 @@ builtin setopt noaliases
fi
fi
# Support Zsh plugin standard
LOADED_PLUGINS+=( "$user/$plugin" )
(( ${+ZPLG_ICE[atinit]} )) && { local __oldcd="$PWD"; builtin cd -q "${${${(M)user:#%}:+$plugin}:-${ZPLGM[PLUGINS_DIR]}/${user}---${plugin}}" && eval "${ZPLG_ICE[atinit]}"; builtin cd -q "$__oldcd"; }
-zplg-load-plugin "$user" "$plugin" "$mode"