'main': Let _zsh_highlight_main__type return false on failure.
This commit is contained in:
parent
82c39716eb
commit
f3425e18fe
@ -170,6 +170,8 @@ _zsh_highlight_main__type() {
|
|||||||
if (( $+_zsh_highlight_main__command_type_cache )); then
|
if (( $+_zsh_highlight_main__command_type_cache )); then
|
||||||
_zsh_highlight_main__command_type_cache[(e)$1]=$REPLY
|
_zsh_highlight_main__command_type_cache[(e)$1]=$REPLY
|
||||||
fi
|
fi
|
||||||
|
[[ -n $REPLY ]]
|
||||||
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check whether the first argument is a redirection operator token.
|
# Check whether the first argument is a redirection operator token.
|
||||||
@ -584,7 +586,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||||||
style=reserved-word # de facto a reserved word, although not de jure
|
style=reserved-word # de facto a reserved word, although not de jure
|
||||||
next_word=':start:'
|
next_word=':start:'
|
||||||
elif [[ $this_word == *':start:'* ]] && (( in_redirection == 0 )); then # $arg is the command word
|
elif [[ $this_word == *':start:'* ]] && (( in_redirection == 0 )); then # $arg is the command word
|
||||||
if (( ${+precommand_options[$arg]} )) && { _zsh_highlight_main__type $arg; [[ -n $REPLY && $REPLY != "none" ]] }; then
|
if (( ${+precommand_options[$arg]} )) && { _zsh_highlight_main__type $arg && [[ $REPLY != "none" ]] }; then
|
||||||
style=precommand
|
style=precommand
|
||||||
flags_with_argument=${precommand_options[$arg]%:*}
|
flags_with_argument=${precommand_options[$arg]%:*}
|
||||||
flags_sans_argument=${precommand_options[$arg]#*:}
|
flags_sans_argument=${precommand_options[$arg]#*:}
|
||||||
@ -666,7 +668,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||||||
if (( insane_alias )); then
|
if (( insane_alias )); then
|
||||||
style=unknown-token
|
style=unknown-token
|
||||||
# Calling 'type' again; since __type memoizes the answer, this call is just a hash lookup.
|
# Calling 'type' again; since __type memoizes the answer, this call is just a hash lookup.
|
||||||
elif _zsh_highlight_main__type "$arg"; [[ $REPLY == 'none' ]]; then
|
elif _zsh_highlight_main__type "$arg" && [[ $REPLY == 'none' ]]; then
|
||||||
style=unknown-token
|
style=unknown-token
|
||||||
else
|
else
|
||||||
# The common case.
|
# The common case.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user