Skip to content

Commit

Permalink
Simplify per @tarjoilija's feedback
Browse files Browse the repository at this point in the history
Use source in `${ZGEN_INIT}` instead of -zgen-source. Fixes tarjoilija#7, with the
welcome side effect of being 11% faster.
  • Loading branch information
unixorn committed Dec 23, 2014
1 parent 541852e commit 7c670d1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions zgen.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ zgen-save() {
echo "# This file will be overwritten the next time you run zgen save" >> "${ZGEN_INIT}"
echo "#" >> "${ZGEN_INIT}"
for file in "${ZGEN_LOADED[@]}"; do
echo "-zgen-source \"$file\"" >> "${ZGEN_INIT}"
echo "source \"$file\"" >> "${ZGEN_INIT}"
done

# Set up fpath
Expand All @@ -96,14 +96,6 @@ zgen-save() {
echo "# Add our plugins and completions to fpath">> "${ZGEN_INIT}"
echo "#" >> "${ZGEN_INIT}"
echo "fpath=(\$fpath $ZGEN_COMPLETIONS )" >> "${ZGEN_INIT}"

# Reset
echo >> "${ZGEN_INIT}"
echo "#" >> "${ZGEN_INIT}"
echo "# Clear ZGEN_LOADED and ZGEN_COMPLETIONS per #7">> "${ZGEN_INIT}"
echo "#" >> "${ZGEN_INIT}"
echo "ZGEN_LOADED=()" >> "${ZGEN_INIT}"
echo "ZGEN_COMPLETIONS=()" >> "${ZGEN_INIT}"
}

zgen-completions() {
Expand Down

0 comments on commit 7c670d1

Please sign in to comment.