summaryrefslogtreecommitdiff
path: root/themes/pygmalion.zsh-theme
diff options
context:
space:
mode:
authorJacob Tomaw <jacob.tomaw@gmail.com>2019-11-19 12:47:12 -0500
committerMarc Cornellà <marc.cornella@live.com>2019-11-19 18:47:12 +0100
commit1ba0af650ac575a7d35b10146d2e7a7b3b2e2ae6 (patch)
tree43f201ed985a63230fae98a20c84118278eb3fc1 /themes/pygmalion.zsh-theme
parentd4f32e9f3a6471ce689aa8fb5a9f04e8565bcff6 (diff)
downloadzsh-1ba0af650ac575a7d35b10146d2e7a7b3b2e2ae6.tar.gz
zsh-1ba0af650ac575a7d35b10146d2e7a7b3b2e2ae6.tar.bz2
zsh-1ba0af650ac575a7d35b10146d2e7a7b3b2e2ae6.zip
Use safer append to hook function arrays (#8406)
Use add-zsh-hook to add functions to hooks. That way they won't be added again when doing `source ~/.zshrc` multiple times. Co-authored-by: Marc Cornellà <marc.cornella@live.com>
Diffstat (limited to 'themes/pygmalion.zsh-theme')
-rw-r--r--themes/pygmalion.zsh-theme5
1 files changed, 2 insertions, 3 deletions
diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme
index 5f5fe7f9a..cd773e4a4 100644
--- a/themes/pygmalion.zsh-theme
+++ b/themes/pygmalion.zsh-theme
@@ -12,7 +12,8 @@ prompt_setup_pygmalion(){
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
- precmd_functions+=(prompt_pygmalion_precmd)
+ autoload -U add-zsh-hook
+ add-zsh-hook precmd prompt_pygmalion_precmd
}
prompt_pygmalion_precmd(){
@@ -30,5 +31,3 @@ prompt_pygmalion_precmd(){
}
prompt_setup_pygmalion
-
-