fix: assign to functions hash to make %x work

The useful %x prompt expansion can be used to get path to the executed script:
0=${(%):-%x}

It is always the correct, expected value, even for autoloaded functions. However,
it currently doesn't work with Zinit special fpath-pollution free autoload.
This patch fixes this.
This commit is contained in:
Sebastian Gniazdowski 2023-01-13 16:33:59 +00:59
parent 52e112c7c3
commit bd65a01734

View file

@ -395,11 +395,11 @@ builtin setopt noaliases
retval=$?
}
} else {
eval "function ${(q)func} {
functions[$func]="
local -a fpath
fpath=( ${(qqq)PLUGIN_DIR} ${(qqq@)fpath_elements} ${(qqq@)fpath} )
builtin autoload -X ${(j: :)${(q-)opts[@]}}
}"
"
retval=$?
}
else