zsh:autoload: Fix loading of symlinked functions

Only plain files were autoloaded because of the glob qualifier. Switch
to no-directories so that symlinks (e.g. git-ssh-and-https) are loaded.
This commit is contained in:
2025-06-19 12:49:01 +02:00
parent 28903758a8
commit 9ed2f526da

View File

@@ -14,7 +14,7 @@ if [[ -d "$ZDOTDIR/autoload" ]]; then
# Include all wrapper scripts if their wrapped command exists
for d in "$ZDOTDIR/autoload/"**/wrapper(/N); do
fpath=("$d" $fpath)
for f in "$d"/[^_.]*(.xN:t); do
for f in "$d"/[^_.]*(xN^/:t); do
(( $+commands[$f] )) || continue
autoload -Uz -- "$f"
done
@@ -26,9 +26,9 @@ if [[ -d "$ZDOTDIR/autoload" ]]; then
[[ ${d:t} != wrapper ]] || continue
fpath=("$d" $fpath)
autoload -Uz -- "" "$d"/[^_.]*(.xN:t)
autoload -Uz -- "" "$d"/[^_.]*(xN^/:t)
done
fpath=("$ZDOTDIR/autoload" $fpath)
autoload -Uz -- "" "${fpath[1]}"/[^_.]*(.xN:t)
autoload -Uz -- "" "${fpath[1]}"/[^_.]*(xN^/:t)
fi