Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pmodule-allow-overrides feature #1780

Merged
merged 2 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,17 @@ function pmodload {
else
locations=(${pmodule_dirs:+${^pmodule_dirs}/$pmodule(-/FN)})
if (( ${#locations} > 1 )); then
print "$0: conflicting module locations: $locations"
continue
if ! zstyle -t ':prezto:load' pmodule-allow-overrides 'yes'; then
print "$0: conflicting module locations: $locations"
continue
fi
elif (( ${#locations} < 1 )); then
print "$0: no such module: $pmodule"
continue
fi

# Grab the full path to this module
pmodule_location=${locations[1]}
pmodule_location=${locations[-1]}

# Add functions to $fpath.
fpath=(${pmodule_location}/functions(/FN) $fpath)
Expand Down
3 changes: 3 additions & 0 deletions runcoms/zpreztorc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ zstyle ':prezto:*:*' color 'yes'
# Add additional directories to load prezto modules from
# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib

# Allow module overrides when pmodule-dirs causes module name collisions
# zstyle ':prezto:load' pmodule-allow-overrides 'yes'

# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'

Expand Down