driver: Simplify initialization of $zsyh_user_options in the fallback codepath.

This commit is contained in:
Daniel Shahaf 2020-03-29 20:52:14 +00:00
parent b8c93afd34
commit f563780236

View File

@ -93,9 +93,13 @@ _zsh_highlight()
canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *}) canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *})
for option in "${canonical_options[@]}"; do for option in "${canonical_options[@]}"; do
[[ -o $option ]] [[ -o $option ]]
# This variable cannot be eliminated c.f. workers/42101. case $? in
onoff=${${=:-off on}[2-$?]} (0) zsyh_user_options+=($option on);;
zsyh_user_options+=($option $onoff) (1) zsyh_user_options+=($option off);;
(*) # Can't happen, surely?
echo "zsh-syntax-highlighting: warning: '[[ -o $option ]]' returned $?"
;;
esac
done done
fi fi
typeset -r zsyh_user_options typeset -r zsyh_user_options