Merge branch 'master' of https://github.com/nicoulaj/zsh-syntax-highlighting
This commit is contained in:
commit
7dea99007a
@ -24,7 +24,7 @@ ZLE_GLOBING='fg=blue,bold'
|
|||||||
|
|
||||||
ZLE_DEFAULT='fg=white,bold'
|
ZLE_DEFAULT='fg=white,bold'
|
||||||
|
|
||||||
ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace')
|
ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace' 'noglob' 'command' 'builtin')
|
||||||
|
|
||||||
_check_path() {
|
_check_path() {
|
||||||
[[ -z $arg ]] && return 1
|
[[ -z $arg ]] && return 1
|
||||||
@ -64,17 +64,20 @@ 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;;
|
||||||
*)
|
*)
|
||||||
style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE
|
if _check_path; then
|
||||||
_check_path && style=$ZLE_PATH_STYLE
|
style=$ZLE_PATH_STYLE
|
||||||
;;
|
else
|
||||||
|
style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
case $arg in
|
case $arg in
|
||||||
|
Loading…
Reference in New Issue
Block a user