From e4172614e81ccaa9a6810d33a92045f9e7a047bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 6 Sep 2026 15:55:21 +0000 Subject: [PATCH] fix(vcs_info): keep lazy wrapper recoverable on autoload failure Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com> --- lib/vcs_info.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/vcs_info.zsh b/lib/vcs_info.zsh index f4c62a081..a30e544e1 100644 --- a/lib/vcs_info.zsh +++ b/lib/vcs_info.zsh @@ -60,8 +60,14 @@ if (( $+functions[VCS_INFO_formats] )); then } else function VCS_INFO_formats { + functions -c VCS_INFO_formats _omz_vcs_info_formats_wrapper unfunction VCS_INFO_formats - autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || return 1 + autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || { + functions -c _omz_vcs_info_formats_wrapper VCS_INFO_formats + unfunction _omz_vcs_info_formats_wrapper + return 1 + } + unfunction _omz_vcs_info_formats_wrapper # We use $tmp here because it's already a local variable in VCS_INFO_formats local PATCH='for tmp (base base-name branch misc revision subdir) hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"'