mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-10-23 15:46:27 +08:00
'main': Fix expansion of positional parameters in _zsh_highlight_main_highlighter__try_expand_parameter.
As described in the last commit's log message, ${parameter_name_pattern]
explicitly matches positional parameters but ${parameters[$MATCH]}
expands to nothing in that case (when, e.g., [[ $MATCH == '1' ]]; note
this is equality of strings, not integers).
As a side effect, this removes the dependency on the zsh/parameter
module for expanding parameters.
This commit is contained in:
parent
2a30d4fb5a
commit
96e6cbe22f
@ -448,9 +448,9 @@ _zsh_highlight_main_highlighter__try_expand_parameter()
|
||||
else
|
||||
parameter_name=${arg:1}
|
||||
fi
|
||||
if [[ $res == none ]] && zmodload -e zsh/parameter &&
|
||||
if [[ $res == none ]] &&
|
||||
[[ ${parameter_name} =~ ^${~parameter_name_pattern}$ ]] &&
|
||||
[[ ${parameters[(e)$MATCH]} != *special* ]]
|
||||
[[ ${(tP)MATCH} != *special* ]]
|
||||
then
|
||||
# Set $arg and update $res.
|
||||
case ${(tP)MATCH} in
|
||||
|
||||
Loading…
Reference in New Issue
Block a user