|
33 | 33 | : ${ZSH_HIGHLIGHT_STYLES[unknown-token]:=fg=red,bold}
|
34 | 34 | : ${ZSH_HIGHLIGHT_STYLES[reserved-word]:=fg=yellow}
|
35 | 35 | : ${ZSH_HIGHLIGHT_STYLES[suffix-alias]:=fg=green,underline}
|
| 36 | +: ${ZSH_HIGHLIGHT_STYLES[global-alias]:=fg=cyan} |
36 | 37 | : ${ZSH_HIGHLIGHT_STYLES[precommand]:=fg=green,underline}
|
37 | 38 | : ${ZSH_HIGHLIGHT_STYLES[commandseparator]:=none}
|
38 | 39 | : ${ZSH_HIGHLIGHT_STYLES[path]:=underline}
|
@@ -106,6 +107,7 @@ _zsh_highlight_main_calculate_fallback() {
|
106 | 107 | local -A fallback_of; fallback_of=(
|
107 | 108 | alias arg0
|
108 | 109 | suffix-alias arg0
|
| 110 | + global-alias dollar-double-quoted-argument |
109 | 111 | builtin arg0
|
110 | 112 | function arg0
|
111 | 113 | command arg0
|
@@ -178,7 +180,9 @@ _zsh_highlight_main__type() {
|
178 | 180 | if (( $+aliases[(e)$1] )); then
|
179 | 181 | may_cache=0
|
180 | 182 | fi
|
181 |
| - if (( $+aliases[(e)$1] )) && (( aliases_allowed )); then |
| 183 | + if false && (( ${+galiases[(e)$1]} )); then |
| 184 | + REPLY='global alias' |
| 185 | + elif (( $+aliases[(e)$1] )) && (( aliases_allowed )); then |
182 | 186 | REPLY=alias
|
183 | 187 | elif [[ $1 == *.* && -n ${1%.*} ]] && (( $+saliases[(e)${1##*.}] )); then
|
184 | 188 | REPLY='suffix alias'
|
@@ -930,6 +934,9 @@ _zsh_highlight_main_highlighter_highlight_list()
|
930 | 934 | ('suffix alias')
|
931 | 935 | style=suffix-alias
|
932 | 936 | ;;
|
| 937 | + ('global alias') |
| 938 | + style=global-alias |
| 939 | + ;; |
933 | 940 | (alias) :;;
|
934 | 941 | (builtin) style=builtin
|
935 | 942 | [[ $arg == $'\x5b' ]] && braces_stack='Q'"$braces_stack"
|
@@ -1014,6 +1021,8 @@ _zsh_highlight_main_highlighter_highlight_list()
|
1014 | 1021 | if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW:#"$arg"} ]]; then
|
1015 | 1022 | next_word=':start::start_of_pipeline:'
|
1016 | 1023 | fi
|
| 1024 | + elif _zsh_highlight_main__type "$arg"; [[ $REPLY == 'global alias' ]]; then # $arg is a global alias that isn't in command position |
| 1025 | + style=global-alias |
1017 | 1026 | else # $arg is a non-command word
|
1018 | 1027 | case $arg in
|
1019 | 1028 | ($'\x29')
|
|
0 commit comments