]> Sergey Matveev's repositories - zsh-autoenv.git/blobdiff - autoenv.zsh
Fix return value of _autoenv_source; use ': $(( .. ))'
[zsh-autoenv.git] / autoenv.zsh
index 3ec01e910407b4d8c3afaf5043409ea23606e6b8..1a01c0731d436d9ad4be46b46b9b28104b945519 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() {
@@ -240,9 +238,9 @@ _autoenv_source() {
   # Change to directory of env file, source it and cd back.
   local new_dir=$PWD
   _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 +337,7 @@ _autoenv_chpwd_handler() {
 
   _autoenv_chpwd_prev_dir=$PWD
 
-  (( _autoenv_debug_indent++ ))
+  : $(( _autoenv_debug_indent++ ))
 }
 # }}}