diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 0bdde36..7da3022 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -200,9 +200,7 @@ _zsh_main-highlight() { *': reserved') style=$ZSH_HIGHLIGHT_STYLES[reserved-word];; *': alias') style=$ZSH_HIGHLIGHT_STYLES[alias] local aliased_command="${"$(alias $arg)"#*=}" - if [[ ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)$aliased_command]:-}:+yes} = 'yes' && ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)$arg]:-}:+yes} != 'yes' ]]; then - ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS+=($arg) - fi + [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS:#"$aliased_command"} && -z ${(M)ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS:#"$arg"} ]] && ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS+=($arg) ;; *': builtin') style=$ZSH_HIGHLIGHT_STYLES[builtin];; *': function') style=$ZSH_HIGHLIGHT_STYLES[function];; @@ -243,7 +241,7 @@ _zsh_main-highlight() { esac fi [[ $substr_color = 0 ]] && region_highlight+=("$start_pos $end_pos $style") - [[ ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]:-}:+yes} = 'yes' ]] && new_expression=true + [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS:#"$arg"} ]] && new_expression=true start_pos=$end_pos done }