Fix tokens followed by commands and aliases bug (thanks to hchbaw)

This commit is contained in:
Julien Nicoulaud 2010-12-31 02:07:24 +01:00
parent a2f022c70f
commit a56a085ca7
2 changed files with 3 additions and 1 deletions

View File

@ -57,3 +57,5 @@ Re-open your terminal, or just reload it to take changes into account:
* [Andreas Jaggi](http://github.com/x-way)
* [Wayne Davison](http://github.com/WayneD)
* [Suraj N. Kurapati](http://github.com/sunaku)
* [Takeshi Banse](http://github.com/hchbaw)

2
zsh-syntax-highlighting.zsh Normal file → Executable file
View File

@ -111,7 +111,7 @@ _zsh_highlight-zle-buffer() {
case $res in
*': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];;
*': alias') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[alias]
local aliased_command=${$(alias $arg)#*=}
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];;