diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index a56061b..1d3bbb6 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -160,6 +160,8 @@ _zsh_highlight_main__type() { if (( $+_zsh_highlight_main__command_type_cache )); then _zsh_highlight_main__command_type_cache[(e)$1]=$REPLY fi + [[ -n $REPLY ]] + return $? } # Check whether the first argument is a redirection operator token. @@ -544,7 +546,7 @@ _zsh_highlight_highlighter_main_paint() style=reserved-word # de facto a reserved word, although not de jure next_word=':start:' 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 flags_with_argument=${precommand_options[$arg]%:*} flags_sans_argument=${precommand_options[$arg]#*:} @@ -626,7 +628,7 @@ _zsh_highlight_highlighter_main_paint() if (( insane_alias )); then style=unknown-token # 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 else # The common case.