From 4f1c59ae51328569c3b256fc57a6c52f6aaaa5d2 Mon Sep 17 00:00:00 2001 From: Eric Nielsen <4120606+ericbn@users.noreply.github.com> Date: Mon, 6 Jan 2025 20:28:40 -0500 Subject: [PATCH] Move down autoload -Uz zargs to a more specific scope and closer to where it's being used. --- src/stage2/20_guard.zsh.erb | 1 - src/stage2/80_zimfw.zsh.erb | 1 + zimfw.zsh | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stage2/20_guard.zsh.erb b/src/stage2/20_guard.zsh.erb index de3f0ce..e90cfef 100644 --- a/src/stage2/20_guard.zsh.erb +++ b/src/stage2/20_guard.zsh.erb @@ -2,7 +2,6 @@ autoload -Uz is-at-least && if ! is-at-least <%= min_zsh_version %>; then print -u2 -R "${_zred}${0}: Error starting zimfw. You're using Zsh version ${_zbold}${ZSH_VERSION}${_znormalred} and versions < ${_zbold}<%= min_zsh_version %>${_znormalred} are not supported. Update your Zsh.${_znormal}" return 1 fi -autoload -Uz zargs # Define zimfw location typeset -g __ZIMFW_FILE=${0} diff --git a/src/stage2/80_zimfw.zsh.erb b/src/stage2/80_zimfw.zsh.erb index 7bdee9c..bae0804 100644 --- a/src/stage2/80_zimfw.zsh.erb +++ b/src/stage2/80_zimfw.zsh.erb @@ -85,6 +85,7 @@ Options: local -A _zfrozens _ztools _zdirs _zurls _ztypes _zrevs _zsubmodules _zonpulls _zifs local -a _zfpaths _zfunctions _zcmds _zunused_dirs local _zrestartmsg=' Restart your terminal for changes to take effect.' + autoload -Uz zargs case ${1} in build) _zimfw_source_zimrc 1 && _zimfw_build || return 1 diff --git a/zimfw.zsh b/zimfw.zsh index ba3f653..c3c326a 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -28,7 +28,6 @@ autoload -Uz is-at-least && if ! is-at-least 5.2; then print -u2 -R "${_zred}${0}: Error starting zimfw. You're using Zsh version ${_zbold}${ZSH_VERSION}${_znormalred} and versions < ${_zbold}5.2${_znormalred} are not supported. Update your Zsh.${_znormal}" return 1 fi -autoload -Uz zargs # Define zimfw location typeset -g __ZIMFW_FILE=${0} @@ -464,7 +463,7 @@ _zimfw_info() { _zimfw_info_print_symlink ZIM_HOME ${ZIM_HOME} _zimfw_info_print_symlink 'zimfw config' ${_zconfig} _zimfw_info_print_symlink 'zimfw script' ${__ZIMFW_FILE} - print -R 'zimfw version: '${_zversion}' (built at 2025-01-07 01:10:19 UTC, previous commit is f51b548)' + print -R 'zimfw version: '${_zversion}' (built at 2025-01-07 01:26:16 UTC, previous commit is 30ab012)' local zparam for zparam in LANG ${(Mk)parameters:#LC_*} OSTYPE TERM TERM_PROGRAM TERM_PROGRAM_VERSION ZSH_VERSION; do print -R ${(r.22....:.)zparam}${(P)zparam} @@ -1039,6 +1038,7 @@ Options: local -A _zfrozens _ztools _zdirs _zurls _ztypes _zrevs _zsubmodules _zonpulls _zifs local -a _zfpaths _zfunctions _zcmds _zunused_dirs local _zrestartmsg=' Restart your terminal for changes to take effect.' + autoload -Uz zargs case ${1} in build) _zimfw_source_zimrc 1 && _zimfw_build || return 1