This change makes the pattern more strict so that expressions that are only in
valid function call forms are added as dependencies. Valid forms of function
use with examples are:
func
func
Leading or trailing whitespaces func
func 'foo'
func\
Trailing backslash:
func\
'foo'
(func)
foo=$(func)
"func"
eval "func"
'func'
eval 'func'
Surrounded by backquotes
`func`
Example:
foo=`func`
Problem Description
Error message:
update_terminalapp_cwd:4: command not found: omz_urlencode
Is shown before every prompt when using Terminal.app on a Mac OS X.
This is because lib/termsupport.zsh is considered a dependency of pip.plugin.zsh and is therefore sourced, adding update_terminalapp_cwd function to the precmd hook.
update_terminalapp_cwd:4: command not found: omz_urlencode
Why this happens
plugins/pip/pip.plugin.zsh has a <title> HTML tag here. There is also a title function defined here. Since zplug only checks the presence of the function name in pip.plugin.zsh, it thinks that the function is being used and sources lib/termsupport.zsh.
Apart from this issue, maybe the check for dependency (i.e. call to __zplug::support::omz::depends) need to be after excluding files specified by the ignore tag, but this is a different issue.
What this PR fixes
In the example, it was <title> (an invalid form of function call) but from what I see it seems like foo_title_bar would also be considered a use of the title function. This PR fixes that scenario too. Valid function uses are described at the top and also in the commit message.
This change makes the pattern more strict so that expressions that are only in valid function call forms are added as dependencies. Valid forms of function use with examples are:
func
func
func
func 'foo'
func\
(func)
foo=$(func)
"func"
eval "func"
'func'
eval 'func'
Surrounded by backquotes
Problem Description
Error message:
Is shown before every prompt when using Terminal.app on a Mac OS X.
This is because
lib/termsupport.zsh
is considered a dependency ofpip.plugin.zsh
and is therefore sourced, addingupdate_terminalapp_cwd
function to theprecmd
hook.Environment
.zshrc
Steps to Reproduce
Observe the message:
Why this happens
plugins/pip/pip.plugin.zsh
has a<title>
HTML tag here. There is also atitle
function defined here. Since zplug only checks the presence of the function name inpip.plugin.zsh
, it thinks that the function is being used and sourceslib/termsupport.zsh
.Apart from this issue, maybe the check for dependency (i.e. call to
__zplug::support::omz::depends
) need to be after excluding files specified by theignore
tag, but this is a different issue.What this PR fixes
In the example, it was
<title>
(an invalid form of function call) but from what I see it seems likefoo_title_bar
would also be considered a use of thetitle
function. This PR fixes that scenario too. Valid function uses are described at the top and also in the commit message.Checking