'main': Highlight array parameters in command position.
This commit is contained in:
committed by
Matthew Martin
parent
ad6261fbca
commit
31ceaed4f4
@@ -553,7 +553,17 @@ _zsh_highlight_main_highlighter_highlight_list()
|
||||
[[ ${parameter_name} =~ ^([A-Za-z_][A-Za-z0-9_]*|[0-9]+)$ ]] &&
|
||||
(( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]]
|
||||
then
|
||||
arg=${(P)MATCH}
|
||||
# Set $arg.
|
||||
case ${(tP)MATCH} in
|
||||
(*array*|*assoc*)
|
||||
local -a words; words=( ${(P)MATCH} )
|
||||
arg=${words[1]}
|
||||
;;
|
||||
(*)
|
||||
# scalar, presumably
|
||||
arg=${(P)MATCH}
|
||||
;;
|
||||
esac
|
||||
_zsh_highlight_main__type "$arg"
|
||||
res=$REPLY
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user