From 9f9e6c24c61c6e3611f8caddcad7be2b537b655a Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Sat, 1 Jan 2011 16:11:13 +0100 Subject: [PATCH] Issue 19: No duplicates in ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS --- zsh-syntax-highlighting.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 3035ddb..4a8b6f2 100755 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -159,7 +159,9 @@ _zsh_highlight-zle-buffer() { *': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];; *': alias') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[alias] local aliased_command=${"$(alias $arg)"#*=} - [[ ${${ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS[(r)$aliased_command]:-}:+yes} = 'yes' ]] && ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS+=($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 ;; *': builtin') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[builtin];; *': function') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[function];;