main: Change conditional to a switch

Prepares for next commit. No functional change.
This commit is contained in:
Matthew Martin 2018-03-14 22:46:49 -05:00
parent beae08776a
commit 73640b79ea

View file

@ -848,14 +848,16 @@ _zsh_highlight_main_highlighter_highlight_argument()
local -a match mbegin mend
local MATCH; integer MBEGIN MEND
if [[ $arg[1] == - ]]; then
if [[ $arg[2] == - ]]; then
base_style=double-hyphen-option
else
base_style=single-hyphen-option
fi
path_eligible=0
fi
case "$arg[1]" in
'-')
if [[ $arg[2] == - ]]; then
base_style=double-hyphen-option
else
base_style=single-hyphen-option
fi
path_eligible=0
;;
esac
for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do
case "$arg[$i]" in