]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - autoenv.zsh
tests: rename setup.sh to setup.zsh
[zsh-autoenv.git] / autoenv.zsh
index 3ec01e910407b4d8c3afaf5043409ea23606e6b8..2fb77ce966da17e50d20e7000216e59e307e6dcd 100644 (file)
@@ -41,10 +41,8 @@ autoenv_source_parent() {
 # Internal functions. {{{
 # Internal: stack of entered (and handled) directories. {{{
 typeset -g -a _autoenv_stack_entered
-_autoenv_stack_entered=()
 # -g: make it global, this is required when used with antigen.
 typeset -g -A _autoenv_stack_entered_mtime
-_autoenv_stack_entered_mtime=()
 
 # Add an entry to the stack, and remember its mtime.
 _autoenv_stack_entered_add() {
@@ -237,12 +235,11 @@ _autoenv_source() {
     # ${env_file:h}.
   fi
 
-  # Change to directory of env file, source it and cd back.
-  local new_dir=$PWD
+  # Source the env file.
   _autoenv_debug "== SOURCE: ${bold_color:-}$env_file${reset_color:-}\n      PWD: $PWD"
-  (( _autoenv_debug_indent++ ))
+  : $(( _autoenv_debug_indent++ ))
   source $env_file
-  (( _autoenv_debug_indent-- ))
+  : $(( _autoenv_debug_indent-- ))
   _autoenv_debug "== END SOURCE =="
 
   if [[ $autoenv_event == enter ]]; then
@@ -339,7 +336,7 @@ _autoenv_chpwd_handler() {
 
   _autoenv_chpwd_prev_dir=$PWD
 
-  (( _autoenv_debug_indent++ ))
+  : $(( _autoenv_debug_indent++ ))
 }
 # }}}