mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-04-17 11:35:32 +08:00
Attempt to fix #670
Don't highlight parameters based on parameter expansion if the expansion type is 'none'.
This commit is contained in:
parent
dde84e1b25
commit
bb97e325e4
@ -628,18 +628,24 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||||||
(( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]]
|
(( ${+parameters[(e)${MATCH}]} )) && [[ ${parameters[(e)$MATCH]} != *special* ]]
|
||||||
then
|
then
|
||||||
# Set $arg.
|
# Set $arg.
|
||||||
|
local -a words
|
||||||
|
local testarg
|
||||||
case ${(tP)MATCH} in
|
case ${(tP)MATCH} in
|
||||||
(*array*|*assoc*)
|
(*array*|*assoc*)
|
||||||
local -a words; words=( ${(P)MATCH} )
|
words=( ${(P)MATCH} )
|
||||||
arg=${words[1]}
|
testarg=${words[1]}
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
# scalar, presumably
|
# scalar, presumably
|
||||||
arg=${(P)MATCH}
|
words=( ${(zP)MATCH} )
|
||||||
|
testarg=${words[1]}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_zsh_highlight_main__type "$arg" 0
|
_zsh_highlight_main__type "$testarg" 0
|
||||||
|
if [[ -n $REPLY ]] && [[ $REPLY != none ]]; then
|
||||||
res=$REPLY
|
res=$REPLY
|
||||||
|
arg=$testarg
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user