main: Consolidate } handling

No functional change.
This commit is contained in:
Matthew Martin 2018-01-14 21:27:07 -06:00
parent 18e214ee5b
commit 8d2955f51a

View File

@ -665,24 +665,16 @@ _zsh_highlight_highlighter_main_paint()
fi fi
style=reserved-word style=reserved-word
;; ;;
$'\x7d') # right brace *) if false; then
# elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then
# Parsing rule: # { # Parsing rule: }
# #
# Additionally, `tt(})' is recognized in any position if neither the # Additionally, `tt(})' is recognized in any position if neither the
# tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set.""" # tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set.
if $right_brace_is_recognised_everywhere; then
_zsh_highlight_main__stack_pop 'Y' style=reserved-word _zsh_highlight_main__stack_pop 'Y' style=reserved-word
if [[ $style == reserved-word ]]; then if [[ $style == reserved-word ]]; then
next_word+=':always:' next_word+=':always:'
fi fi
else
# Fall through to the catchall case at the end.
fi
;|
*) if false; then
elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then
# was handled by the $'\x7d' case above
elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then
style=history-expansion style=history-expansion
elif [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then elif [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then