Perf: optimize parameter check
This commit is contained in:
parent
f063829450
commit
5ac6f101fd
|
|
@ -750,7 +750,8 @@ _zsh_highlight_main_highlighter_highlight_list()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Expand parameters.
|
# Expand parameters.
|
||||||
if (( ! in_param )) && _zsh_highlight_main_highlighter__try_expand_parameter "$arg"; then
|
if (( ! in_param )) && [[ $arg == \$* ]] &&
|
||||||
|
_zsh_highlight_main_highlighter__try_expand_parameter "$arg"; then
|
||||||
# That's not entirely correct --- if the parameter's value happens to be a reserved
|
# That's not entirely correct --- if the parameter's value happens to be a reserved
|
||||||
# word, the parameter expansion will be highlighted as a reserved word --- but that
|
# word, the parameter expansion will be highlighted as a reserved word --- but that
|
||||||
# incorrectness is outweighed by the usability improvement of permitting the use of
|
# incorrectness is outweighed by the usability improvement of permitting the use of
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue