autoenv.zsh | 6 +++--- diff --git a/autoenv.zsh b/autoenv.zsh index c0698c5322b2e063e33d7f3fc3689b278cd2d20e..a66f97a35235f23cd81cb368af450a8b99a5cfad 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -60,7 +60,7 @@ fi } # Internal functions. {{{ -# Internal: stack of entered (and handled) directories. {{{ +# Internal: stack of loaded env files (i.e. entered directories). {{{ typeset -g -a _autoenv_stack_entered # -g: make it global, this is required when used with antigen. typeset -g -A _autoenv_stack_entered_mtime @@ -292,7 +292,7 @@ # Source varstash library once. # XXX: pollutes environment with e.g. `stash`, and `autostash` will cause # an overwritten `stash` function to be called! - if [[ -z "$functions[(I)autostash]" ]]; then + if ! (( $+functions[autostash] )); then if \grep -qE '\b(autostash|autounstash|stash)\b' $autoenv_env_file; then source ${${funcsourcetrace[1]%:*}:h}/lib/varstash fi @@ -410,7 +410,7 @@ _autoenv_source $env_file_leave leave $prev_dir fi # Unstash any autostashed stuff. - if [[ -n "$functions[(I)autostash]" ]]; then + if (( $+functions[autostash] )); then varstash_dir=$prev_dir autounstash fi