From e3edddd8eccec96c4bf05bb6926ead86dc9f7f5a Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 1 Oct 2018 11:56:08 -0400 Subject: [PATCH] main: alias style overrides precommand style --- highlighters/main/main-highlighter.zsh | 2 +- highlighters/main/test-data/noglob-alias.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index ffe68dd..b32d415 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -650,7 +650,7 @@ _zsh_highlight_main_highlighter_highlight_list() next_word=':start:' elif [[ $this_word == *':start:'* ]] && (( in_redirection == 0 )); then # $arg is the command word if (( ${+precommand_options[$arg]} )) && _zsh_highlight_main__is_runnable $arg; then - style=precommand + [[ $res != alias ]] && style=precommand flags_with_argument=${precommand_options[$arg]%:*} flags_sans_argument=${precommand_options[$arg]#*:} next_word=${next_word//:regular:/} diff --git a/highlighters/main/test-data/noglob-alias.zsh b/highlighters/main/test-data/noglob-alias.zsh index e6c9f3c..2f96445 100644 --- a/highlighters/main/test-data/noglob-alias.zsh +++ b/highlighters/main/test-data/noglob-alias.zsh @@ -31,6 +31,6 @@ alias x=command BUFFER='x ls' expected_region_highlight=( - "1 1 precommand" # x + "1 1 alias" # x "3 4 command" # ls )