@ -92,7 +92,7 @@ _zsh_highlight()
typeset -ga ${ cache_place }
# If highlighter needs to be invoked
if " _zsh_highlight_ ${ highlighter } _highlighter _predicate" ; then
if " _zsh_highlight_highlighter_ ${ highlighter } _predicate " ; then
# save a copy, and cleanup region_highlight
region_highlight_copy = ( " ${ region_highlight [@] } " )
@ -100,7 +100,7 @@ _zsh_highlight()
# Execute highlighter and save result
{
" _zsh_highlight_ ${ highlighter } _highlighter "
" _zsh_highlight_highlighter_ ${ highlighter } _paint "
} always {
eval " ${ cache_place } =(\"\${region_highlight[@]}\") "
}
@ -329,13 +329,26 @@ _zsh_highlight_load_highlighters()
local highlighter highlighter_dir
for highlighter_dir ( $1 /*/) ; do
highlighter = " ${ highlighter_dir : t } "
[ [ -f " $highlighter_dir / ${ highlighter } -highlighter.zsh " ] ] && {
[ [ -f " $highlighter_dir / ${ highlighter } -highlighter.zsh " ] ] &&
. " $highlighter_dir / ${ highlighter } -highlighter.zsh "
type " _zsh_highlight_ ${ highlighter } _highlighter " & > /dev/null &&
type " _zsh_highlight_ ${ highlighter } _highlighter_predicate " & > /dev/null || {
print -r -- >& 2 " zsh-syntax-highlighting: ' ${ highlighter } ' highlighter should define both required functions '_zsh_highlight_ ${ highlighter } _highlighter' and '_zsh_highlight_ ${ highlighter } _highlighter_predicate' in ' ${ highlighter_dir } / ${ highlighter } -highlighter.zsh'. "
}
}
if type " _zsh_highlight_highlighter_ ${ highlighter } _paint " & > /dev/null &&
type " _zsh_highlight_highlighter_ ${ highlighter } _predicate " & > /dev/null;
then
# New (0.5.0) function names
elif type " _zsh_highlight_ ${ highlighter } _highlighter " & > /dev/null &&
type " _zsh_highlight_ ${ highlighter } _highlighter_predicate " & > /dev/null;
then
# Old (0.4.x) function names
if false; then
# TODO: only show this warning for plugin authors/maintainers, not for end users
print -r -- >& 2 " zsh-syntax-highlighting: warning: ${ (qq)highlighter } highlighter uses deprecated entry point names; please ask its maintainer to update it: https://github.com/zsh-users/zsh-syntax-highlighting/issues/329 "
fi
# Make it work.
eval " _zsh_highlight_highlighter_ ${ (q)highlighter } _paint() { _zsh_highlight_ ${ (q)highlighter } _highlighter \"\$@\" } "
eval " _zsh_highlight_highlighter_ ${ (q)highlighter } _predicate() { _zsh_highlight_ ${ (q)highlighter } _highlighter_predicate \"\$@\" } "
else
print -r -- >& 2 " zsh-syntax-highlighting: ' ${ highlighter } ' highlighter should define both required functions '_zsh_highlight_highlighter_ ${ highlighter } _paint' and '_zsh_highlight_highlighter_ ${ highlighter } _predicate' in ' ${ highlighter_dir } / ${ highlighter } -highlighter.zsh'. "
fi
done
}