mirror of
https://github.com/zsh-users/zsh-syntax-highlighting
synced 2025-01-08 03:39:34 +00:00
Fix highlighting of external commands & simplify matching.
This commit is contained in:
parent
ff908d1128
commit
be71887386
@ -43,16 +43,19 @@ colorize-zle-buffer() {
|
|||||||
((end_pos=$start_pos+${#arg}))
|
((end_pos=$start_pos+${#arg}))
|
||||||
if $colorize; then
|
if $colorize; then
|
||||||
colorize=false
|
colorize=false
|
||||||
res=$(LC_ALL=C builtin type $arg 2>/dev/null)
|
res=$(LC_ALL=C builtin type -w $arg 2>/dev/null)
|
||||||
case $res in
|
case $res in
|
||||||
*'reserved word'*) style=$ZLE_RESERVED_WORD_STYLE;;
|
*': reserved') style=$ZLE_RESERVED_WORD_STYLE;;
|
||||||
*'an alias'*) style=$ZLE_ALIAS_STYLE;;
|
*': alias') style=$ZLE_ALIAS_STYLE;;
|
||||||
*'shell builtin'*) style=$ZLE_BUILTIN_STYLE;;
|
*': builtin') style=$ZLE_BUILTIN_STYLE;;
|
||||||
*'shell function'*) style=$ZLE_FUNCTION_STYLE;;
|
*': function') style=$ZLE_FUNCTION_STYLE;;
|
||||||
*"${cmd:-no-command-specified} is"*) style=$ZLE_COMMAND_STYLE;;
|
*': command') style=$ZLE_COMMAND_STYLE;;
|
||||||
*)
|
*)
|
||||||
|
if _check_path; then
|
||||||
|
style=$ZLE_PATH_STYLE
|
||||||
|
else
|
||||||
style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE
|
style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE
|
||||||
_check_path && style=$ZLE_PATH_STYLE
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user