Issue 9: take into account aliases for tokens followed by commands

This commit is contained in:
Julien Nicoulaud 2010-12-30 19:18:17 +01:00
parent 97d944743a
commit 204e8f1b93

View File

@ -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];;