Skip to content

Commit

Permalink
Fix localoptions being set for first zgenom call (tarjoilija#105)
Browse files Browse the repository at this point in the history
When zgenom was fully loaded (`__zgenom`) localoptions and extendedglob
was being set to find all autoloaded functions.
This localoptions would prevent setting any options from the file
sourced by this first call.
So when for example the first call was `zgenom load my/plugin`
`my/plugin` wouldn't be able to set any options. This would only occur
in the first shell after `zgenom reset` since this issue would not
persist in the generated `init.zsh`.

Closes tarjoilija#101
  • Loading branch information
jandamm authored Dec 27, 2021
1 parent 7d4e1d0 commit 977af76
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions functions/__zgenom
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env zsh

# Autoload all functions
setopt localoptions extendedglob
for func in $ZGEN_SOURCE/functions/(__|)zgenom(-|_)*~*.zwc; do
autoload -Uz ${func:t}
done
(){
setopt localoptions extendedglob
for func in $ZGEN_SOURCE/functions/(__|)zgenom(-|_)*~*.zwc; do
autoload -Uz ${func:t}
done
}

# Set all options
source "$ZGEN_SOURCE/options.zsh"
Expand Down

0 comments on commit 977af76

Please sign in to comment.