From 1e990f925efb9fdb59eef31855abce7434d0d207 Mon Sep 17 00:00:00 2001 From: Thilo Six Date: Sun, 5 Feb 2017 20:42:57 +0100 Subject: [PATCH] only try to autoload, when there actually is s.th. to This fixes a regression introduced today: Only try to autoload, when there actually is s.th. to autoload otherwise "autoload -U" _prints_ all functions that were marked for autoloading thus far. --- etc/zsh/zshrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index d9e5ac8..48ae2e9 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -616,8 +616,10 @@ isdarwin && xsource /sw/bin/init.sh for fdir in /usr/share/grml/zsh/completion /usr/share/grml/zsh/functions; do fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} ) done -unset -v fdir -autoload -U /usr/share/grml/zsh/functions/**/[^_]*[^~](N.:t) +typeset -aU ffiles +ffiles=(/usr/share/grml/zsh/functions/**/[^_]*[^~](N.:t)) +(( ${#files} > 0 )) && autoload -U "${ffiles[@]}" +unset -v fdir ffiles # support colors in less export LESS_TERMCAP_mb=$'\E[01;31m' -- 2.1.4