-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support prezto function loading #428
Conversation
src/ext/zcache/functions.zsh
Outdated
local location | ||
|
||
local pfunction_glob='^([_.]*|prompt_*_setup|README*|*~)(-.N:t)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to not have this copied in a few different files, just not sure how to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be moved inside a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure the best way to move this (and the loop) into a function, as they do similar but different things.
src/ext/zcache/functions.zsh
Outdated
done | ||
|
||
_payload+="fpath+=(${_extensions_paths[@]});\NL" | ||
_payload+="unset __ZCACHE_FILE_PATH;\NL" | ||
if [[ ! -z "${_autoloaded_functions}" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure there's a better way of doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be if (( $#_autoloaded_functions )); then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some code duplication around if [[ -d "$location/functions" ]]; then
. Let's try to avoid it.
Other than that it looks great!
I'll wait for this to be merged before next release as this is quite important :) |
I'd be happy to resolve the conflicts, but I don't see a great way of refactoring this into a function |
I'll take a look and see what I can do! Sorry for the conflicts, had to merge |
There are a few parts of this. The first is making sure the /functions dir is added to the fpath (and all the functions autoloaded) and the second is moving fpath updates to before all the modules are sourced.
Please note that this is a WIP and suggestions would be welcome.