# check for versions (compatibility reasons)
if autoload is-at-least && is-at-least 2>/dev/null ; then
is4() { is-at-least 4 }
+ is41() { is-at-least 4.1 }
is42() { is-at-least 4.2 }
else
is4(){
done
# autoload zsh modules when they are referenced
- is4 && for opt mod in a stat \
- a zpty \
- ap zprof \
- ap mapfile ; do
- zmodload -${opt} zsh/${mod} ${mod}
- done ; unset opt mod
+ if is4 ; then
+ tmpargs=(
+ a stat
+ a zpty
+ ap zprof
+ ap mapfile
+ )
+
+ while (( ${#tmpargs} > 0 )) ; do
+ zmodload -${tmpargs[1]} zsh/${tmpargs[2]} ${tmpargs[2]}
+ shift 2 tmpargs
+ done
+ unset tmpargs
+ fi
is4 && autoload -U insert-files && \
zle -N insert-files && \
# precmd () { setopt promptsubst; [[ -o interactive ]] && jobs -l;
# make sure to use right prompt only when not running a command
- is4 && setopt transient_rprompt
+ is41 && setopt transient_rprompt
is4 && [[ -z $NOPRECMD ]] && precmd () {
[[ -n $NOPRECMD ]] && return 0