zpm-zsh/zpm

report error when start with zsh-users/zsh-history-substring-search

wweir opened this issue · 8 comments

wweir commented

put zpm load zsh-users/zsh-history-substring-search into .zshrc

run zsh, it report:
/var/folders/ss/nftfg4t90cj6546f877r5rf40000gn/T//zsh-501/zpm-cache.zsh:source:1881: no such file or directory: /private/var/folders/ss/nftfg4t90cj6546f877r5rf40000gn/T/zsh-501/zsh-history-substring-search.zsh
图片

@wweir This error appears because zsh-users/zsh-history-substring-search doesn't support $0 from zsh plugin standard

You can source zsh-history-substring-search.zsh directly zpm zsh-users/zsh-history-substring-search,source:zsh-history-substring-search.zsh,async

Also, I recommend async tag, for faster loading

wweir commented

FYI
Maybe the sourced content can be wrapped in a function or some other scope.

@wweir Why do you need wrapping?

wweir commented

@horosgrisa Just like zsh-history-substring-search, nobody can make sure all plugins they need are compatible with zpm.
The cost of resolving compatibility issues is quite high.

Do you think that wrapping will help?

wweir commented

I not sure if wrapping by a function will help, but the code sourced should be wrapped by something to reduce mutual interference

@wweir I thought about this, but I don't want to add wrapping for efficiency and speed

@wweir Now plugins will be wrapped into anonymous function. Check next branch.