fixup! 'main': Learn $flags_sans_arguments and use that to parse '-xy foo' correctly where -x takes no argument and -y does.

This commit is contained in:
Daniel Shahaf 2018-01-12 16:05:04 +00:00
parent a3bc345e54
commit 4480eb6cf8

View File

@ -538,7 +538,7 @@ _zsh_highlight_highlighter_main_paint()
if (( ! in_redirection )); then
if [[ $this_word == *':sudo_opt:'* ]]; then
if [[ -n $flags_with_argument ]] &&
( setopt extendedglob; [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]] ); then
[[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]]; then
# Flag that requires an argument
this_word=${this_word//:start:/}
next_word=':sudo_arg:'