038931039030911852d456215d6f39385d5b7a6e

Author
Marc Cornellà <marc@mcornella.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(lib/git): fix detection of function use in prompt

RPS1 and RPROMPT are not equivalent, though they have the same effect.
Added both to detect if `git_prompt_*` is used.

Fixes #12325

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index 23d11db2d738ac61620b1144d2608d4944672176..c4265970bb9756393642618485df49c62d6115d2 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -57,13 +57,13 @@ if zstyle -T ':omz:alpha:lib:git' async-prompt; then
 6   # or any of the other prompt variables
 7   function _defer_async_git_register() {
 8     # Check if git_prompt_info is used in a prompt variable
 9-    case "${PS1}:${PS2}:${PS3}:${PS4}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
10+    case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
11     *(\$\(git_prompt_info\)|\`git_prompt_info\`)*)
12       _omz_register_handler _omz_git_prompt_info
13       ;;
14     esac
15 
16-    case "${PS1}:${PS2}:${PS3}:${PS4}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
17+    case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
18     *(\$\(git_prompt_status\)|\`git_prompt_status\`)*)
19       _omz_register_handler _omz_git_prompt_status
20       ;;