From 6811cc2638382240bf9cdf25251ee269816135e0 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Tue, 21 May 2024 10:03:16 -0400 Subject: [PATCH] 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 --- lib/git.zsh | 4 ---- themes/gentoo-wilder.zsh-theme | 6 ------ 2 files changed, 10 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 8d38f3268..8721154c9 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -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\`)*) diff --git a/themes/gentoo-wilder.zsh-theme b/themes/gentoo-wilder.zsh-theme index 4d8ba61e1..078c01497 100644 --- a/themes/gentoo-wilder.zsh-theme +++ b/themes/gentoo-wilder.zsh-theme @@ -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