Skip to content

Commit

Permalink
fix: assign to functions hash to make %x work
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
psprint committed Jan 13, 2023
1 parent 52e112c commit bd65a01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bd65a01

Please sign in to comment.