Skip to content
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

Merged
merged 4 commits into from
Mar 14, 2017
Merged

Support prezto function loading #428

merged 4 commits into from
Mar 14, 2017

Conversation

belak
Copy link
Contributor

@belak belak commented Mar 10, 2017

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.

local location

local pfunction_glob='^([_.]*|prompt_*_setup|README*|*~)(-.N:t)'
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

done

_payload+="fpath+=(${_extensions_paths[@]});\NL"
_payload+="unset __ZCACHE_FILE_PATH;\NL"
if [[ ! -z "${_autoloaded_functions}" ]]; then
Copy link
Contributor Author

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.

Copy link
Member

@desyncr desyncr Mar 11, 2017

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

@desyncr desyncr self-assigned this Mar 11, 2017
@desyncr desyncr self-requested a review March 11, 2017 00:13
@desyncr desyncr added the Bug label Mar 11, 2017
@desyncr desyncr removed their assignment Mar 11, 2017
@desyncr desyncr added this to the 2.0.0 milestone Mar 11, 2017
Copy link
Member

@desyncr desyncr left a 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!

@desyncr desyncr changed the title Support prezto function autoloading WIP: Support prezto function autoloading Mar 11, 2017
@desyncr
Copy link
Member

desyncr commented Mar 11, 2017

I'll wait for this to be merged before next release as this is quite important :)

@belak
Copy link
Contributor Author

belak commented Mar 12, 2017

I'd be happy to resolve the conflicts, but I don't see a great way of refactoring this into a function

@desyncr
Copy link
Member

desyncr commented Mar 12, 2017

I'll take a look and see what I can do! Sorry for the conflicts, had to merge v2 branch!

@belak belak changed the title WIP: Support prezto function autoloading Support prezto function loading Mar 13, 2017
@desyncr desyncr merged commit 8ed5106 into zsh-users:develop Mar 14, 2017
@belak belak deleted the prezto-autoload-functions branch March 14, 2017 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants