Skip to content

Commit

Permalink
driver: Simplify initialization of $zsyh_user_options in the fallback…
Browse files Browse the repository at this point in the history
… codepath.
  • Loading branch information
danielshahaf committed Mar 29, 2020
1 parent b8c93af commit f563780
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions zsh-syntax-highlighting.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ _zsh_highlight()
canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *})
for option in "${canonical_options[@]}"; do
[[ -o $option ]]
# This variable cannot be eliminated c.f. workers/42101.
onoff=${${=:-off on}[2-$?]}
zsyh_user_options+=($option $onoff)
case $? in
(0) zsyh_user_options+=($option on);;
(1) zsyh_user_options+=($option off);;
(*) # Can't happen, surely?
echo "zsh-syntax-highlighting: warning: '[[ -o $option ]]' returned $?"
;;
esac
done
fi
typeset -r zsyh_user_options
Expand Down

0 comments on commit f563780

Please sign in to comment.