From 204e8f1b932cc3382fae7bde58c3dcf398aeb77f Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Thu, 30 Dec 2010 19:18:17 +0100 Subject: [PATCH] Issue 9: take into account aliases for tokens followed by commands --- zsh-syntax-highlighting.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 94be7ce..2157172 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -100,7 +100,10 @@ _zsh_highlight-zle-buffer() { res=$(LC_ALL=C builtin type -w $arg 2>/dev/null) case $res in *': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];; - *': alias') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[alias];; + *': 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) + ;; *': builtin') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[builtin];; *': function') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[function];; *': command') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[command];;