mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-06-05 12:36:30 +08:00
Merge ff6681ccd4
into 11c9081967
This commit is contained in:
commit
b88ade3463
@ -101,7 +101,13 @@ _zsh_highlight_main__type() {
|
|||||||
fi
|
fi
|
||||||
unset REPLY
|
unset REPLY
|
||||||
if zmodload -e zsh/parameter; then
|
if zmodload -e zsh/parameter; then
|
||||||
if (( $+aliases[(e)$1] )); then
|
if ! builtin type -w -- $1 >/dev/null 2>&1; then
|
||||||
|
REPLY=none
|
||||||
|
# work around zsh bug: even if type -w encounters an invalid command,
|
||||||
|
# it hashes it anyways. http://www.zsh.org/mla/workers/2016/msg01583.html
|
||||||
|
# we force an unhash here to keep the hash tables clean.
|
||||||
|
(( $+commands[(e)$1] )) && unhash $1
|
||||||
|
elif (( $+aliases[(e)$1] )); then
|
||||||
REPLY=alias
|
REPLY=alias
|
||||||
elif (( $+saliases[(e)${1##*.}] )); then
|
elif (( $+saliases[(e)${1##*.}] )); then
|
||||||
REPLY='suffix alias'
|
REPLY='suffix alias'
|
||||||
@ -113,8 +119,6 @@ _zsh_highlight_main__type() {
|
|||||||
REPLY=builtin
|
REPLY=builtin
|
||||||
elif (( $+commands[(e)$1] )); then
|
elif (( $+commands[(e)$1] )); then
|
||||||
REPLY=command
|
REPLY=command
|
||||||
elif ! builtin type -w -- $1 >/dev/null 2>&1; then
|
|
||||||
REPLY=none
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! (( $+REPLY )); then
|
if ! (( $+REPLY )); then
|
||||||
|
Loading…
Reference in New Issue
Block a user