Perf: add a comment explaining [[ -n $1(#q-.*N) ]]

This commit is contained in:
Roman Perepelitsa 2020-09-01 15:24:02 +02:00
parent 2f9808f90e
commit 8d78ed8790

View File

@ -189,6 +189,7 @@ _zsh_highlight_main__type() {
# zsh release at the time of writing). # zsh release at the time of writing).
elif [[ $ZSH_VERSION == 5.<1-8>(|.*) ]]; then elif [[ $ZSH_VERSION == 5.<1-8>(|.*) ]]; then
if [[ $1 == */* ]]; then if [[ $1 == */* ]]; then
# [[ -n $1(#q-.*N) ]] is a faster version of [[ -f $1 && -x $1 ]].
if [[ -n $1(#q-.*N) || if [[ -n $1(#q-.*N) ||
$1 != /* && $zsyh_user_options[pathdirs] == on && -n ${^path}/$1(#q-.*N) ]]; then $1 != /* && $zsyh_user_options[pathdirs] == on && -n ${^path}/$1(#q-.*N) ]]; then
REPLY=command REPLY=command