diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 12e48fe..06839ce 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -163,7 +163,7 @@ _zsh_highlight_main__type() { fi if (( $+aliases[(e)$1] )) && (( aliases_allowed )); then REPLY=alias - elif (( $+saliases[(e)${1##*.}] )); then + elif [[ $1 == *.* && -n ${1%.*} ]] && (( $+saliases[(e)${1##*.}] )); then REPLY='suffix alias' elif (( $reswords[(Ie)$1] )); then REPLY=reserved diff --git a/highlighters/main/test-data/alias.zsh b/highlighters/main/test-data/alias.zsh index 8330a04..03ca0be 100644 --- a/highlighters/main/test-data/alias.zsh +++ b/highlighters/main/test-data/alias.zsh @@ -31,7 +31,7 @@ alias alias1="ls" alias -s alias2="echo" function alias1() {} # to check that it's highlighted as an alias, not as a function -BUFFER='x.alias2; alias1' +BUFFER='x.alias2; alias1; alias2' # Set expected_region_highlight as a function of zsh version. # @@ -49,4 +49,6 @@ expected_region_highlight+=( "9 9 commandseparator" # ; "11 16 alias" # alias1 "11 16 command" # alias1 (ls) + "17 17 commandseparator" # ; + "19 24 unknown-token" # alias2 )