Issue 9: take into account aliases for tokens followed by commands
This commit is contained in:
parent
97d944743a
commit
204e8f1b93
@ -100,7 +100,10 @@ _zsh_highlight-zle-buffer() {
|
|||||||
res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
|
res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
|
||||||
case $res in
|
case $res in
|
||||||
*': reserved') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[reserved-word];;
|
*': 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];;
|
*': builtin') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[builtin];;
|
||||||
*': function') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[function];;
|
*': function') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[function];;
|
||||||
*': command') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[command];;
|
*': command') style=$ZSH_SYNTAX_HIGHLIGHTING_STYLES[command];;
|
||||||
|
Loading…
Reference in New Issue
Block a user