From ebcfcc28f6f80f239576c9e898b03fab398135e2 Mon Sep 17 00:00:00 2001 From: RIT80 <55622 08+RIT80@users.noreply.github.com> Date: Mon, 13 Jan 2020 18:49:37 -0500 Subject: [PATCH] Support pmodule-allow-overrides feature (#1780) --- init.zsh | 8 +++++--- runcoms/zpreztorc | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/init.zsh b/init.zsh index 87f095e5955..254ae52cc2c 100644 --- a/init.zsh +++ b/init.zsh @@ -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) diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index a54907344c8..9a3c19ae3fe 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -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'