mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-24 20:33:04 +00:00
*highlight: Command, builtin, alias, function – order of type checking
This commit is contained in:
parent
22d839f3bc
commit
c04b09873a
1 changed files with 7 additions and 7 deletions
|
@ -82,18 +82,18 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
|
|||
fi
|
||||
unset REPLY
|
||||
if zmodload -e zsh/parameter; then
|
||||
if (( $+aliases[(e)$1] )); then
|
||||
if (( $+commands[(e)$1] )); then
|
||||
REPLY=command
|
||||
elif (( $+builtins[(e)$1] )); then
|
||||
REPLY=builtin
|
||||
elif (( $+aliases[(e)$1] )); then
|
||||
REPLY=alias
|
||||
elif (( $+functions[(e)$1] )); then
|
||||
REPLY=function
|
||||
elif (( $+saliases[(e)${1##*.}] )); then
|
||||
REPLY='suffix alias'
|
||||
elif (( $reswords[(Ie)$1] )); then
|
||||
REPLY=reserved
|
||||
elif (( $+functions[(e)$1] )); then
|
||||
REPLY=function
|
||||
elif (( $+builtins[(e)$1] )); then
|
||||
REPLY=builtin
|
||||
elif (( $+commands[(e)$1] )); then
|
||||
REPLY=command
|
||||
# zsh 5.2 and older have a bug whereby running 'type -w ./sudo' implicitly
|
||||
# runs 'hash ./sudo=/usr/local/bin/./sudo' (assuming /usr/local/bin/sudo
|
||||
# exists and is in $PATH). Avoid triggering the bug, at the expense of
|
||||
|
|
Loading…
Reference in a new issue