'main': Use a more robust way of testing for $parameters' availability.

This commit is contained in:
Daniel Shahaf 2018-01-12 13:49:03 +00:00 committed by Matthew Martin
parent 3a33ac1d20
commit ad6261fbca

View File

@ -549,7 +549,7 @@ _zsh_highlight_main_highlighter_highlight_list()
elif [[ $arg[1] == '$' ]]; then
parameter_name=${arg:1}
fi
if [[ $res == none ]] && (( ${+parameters} )) &&
if [[ $res == none ]] && zmodload -e zsh/parameter &&
[[ ${parameter_name} =~ ^([A-Za-z_][A-Za-z0-9_]*|[0-9]+)$ ]] &&
(( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]]
then