Skip to content

Commit f563780

Browse files
committed
driver: Simplify initialization of $zsyh_user_options in the fallback codepath.
1 parent b8c93af commit f563780

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

zsh-syntax-highlighting.zsh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,13 @@ _zsh_highlight()
9393
canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *})
9494
for option in "${canonical_options[@]}"; do
9595
[[ -o $option ]]
96-
# This variable cannot be eliminated c.f. workers/42101.
97-
onoff=${${=:-off on}[2-$?]}
98-
zsyh_user_options+=($option $onoff)
96+
case $? in
97+
(0) zsyh_user_options+=($option on);;
98+
(1) zsyh_user_options+=($option off);;
99+
(*) # Can't happen, surely?
100+
echo "zsh-syntax-highlighting: warning: '[[ -o $option ]]' returned $?"
101+
;;
102+
esac
99103
done
100104
fi
101105
typeset -r zsyh_user_options

0 commit comments

Comments
 (0)