Force registering of async git_prompt_info

In my setup the $git_prompt_info variable is wrapped in a function;
hence it does not trigger the regex in the git library of oh-my-zsh.

This patches away the check and force registering the handler

I also remove the workaround that I previously inserted in the theme
master
Jacopo De Simoi 2 years ago
parent aa950eb191
commit 66638e5d05
  1. 4
      lib/git.zsh
  2. 6
      themes/gentoo-wilder.zsh-theme

@ -162,11 +162,7 @@ if zstyle -t ':omz:alpha:lib:git' async-prompt \
# or any of the other prompt variables
function _defer_async_git_register() {
# Check if git_prompt_info is used in a prompt variable
case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
*(\$\(git_prompt_info\)|\`git_prompt_info\`)*)
_omz_register_handler _omz_git_prompt_info
;;
esac
case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
*(\$\(git_prompt_status\)|\`git_prompt_status\`)*)

@ -64,9 +64,3 @@ ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX="%{\033[0;36m%} "
ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX="↑%{$fg_bold[blue]%}"
ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX="%{\033[0;36m%} "
ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX="↓%{$fg_bold[blue]%}"
# This is needed to have the async branch prompt working properly.
# the reason why it does not work out of the box is that we use the
# wrapper git_stuff in our prompt instead of the plain git_prompt_info.
_omz_register_handler _omz_git_prompt_info

Loading…
Cancel
Save