mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-04-17 11:35:32 +08:00
Perf: optimize parameter check
This commit is contained in:
parent
f063829450
commit
5ac6f101fd
@ -750,7 +750,8 @@ _zsh_highlight_main_highlighter_highlight_list()
|
||||
fi
|
||||
|
||||
# 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
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user