function accept-line() {
setopt localoptions noksharrays
- local -ax cmdline
+ local -a cmdline
local -x alcontext
local buf com fname format msg default_action
DIRSTACKFILE=${DIRSTACKFILE:-${ZDOTDIR:-${HOME}}/.zdirs}
if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
- dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
+ # Enabling NULL_GLOB via (N) weeds out any non-existing
+ # directories from the saved dir-stack file.
+ dirstack=( ${(f)"$(< $DIRSTACKFILE)"}(N) )
# "cd -" won't work after login by just setting $OLDPWD, so
[[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
fi
chpwd() {
if (( $DIRSTACKSIZE <= 0 )) || [[ -z $DIRSTACKFILE ]]; then return; fi
- local -ax my_stack
+ local -a my_stack
my_stack=( ${PWD} ${dirstack} )
if is42 ; then
builtin print -l ${(u)my_stack} >! ${DIRSTACKFILE}