From 7383baf4cff9a1621b9b5517689a5653ae86e123 Mon Sep 17 00:00:00 2001 From: Marlon Richert Date: Sun, 16 May 2021 21:18:06 -0700 Subject: 48853: improved handling of theme resets when changing prompt themes, especially for theme preview --- Doc/Zsh/contrib.yo | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index b777703b3..a972f08d6 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -2041,10 +2041,12 @@ setopts (tt(promptbang), etc.) are turned on, all other prompt-related options are turned off. The tt(prompt_opts) array preserves setopts even beyond the scope of tt(localoptions), should your function need that. ) -item(Modify precmd and preexec)( -Use of tt(add-zsh-hook) is recommended. The tt(precmd) and tt(preexec) -hooks are automatically adjusted if the prompt theme changes or is -disabled. +item(Modify hooks)( +Use of tt(add-zsh-hook) and tt(add-zle-hook-widget) is recommended (see +ifzman(the bf(Manipulating Hook Functions) section above)\ +ifnzman(noderef(Manipulating Hook Functions))\ +). All hooks that follow the naming pattern tt(prompt_)var(theme)tt(_)var(hook) +are automatically removed when the prompt theme changes or is disabled. ) item(Declare cleanup)( If your function makes any other changes that should be undone when the -- cgit 1.4.1