From 44fd26a0cc800a62fe75138e6bdefc3131010be1 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 25 Dec 2010 18:07:01 -0800 Subject: [PATCH] Fix potential errors for some setopt variations. --- zsh-syntax-highlighting.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 0091c90..0d50f37 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -25,6 +25,7 @@ ZLE_DEFAULT='fg=white,bold' ZLE_TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'start' 'time' 'strace' 'ยง') _check_path() { + setopt localoptions null_glob [ -z "$arg" ] && return 1 [ -e $arg ] && return 0 [ ! -e "`dirname $arg`" ] && return 1 @@ -48,7 +49,7 @@ colorize-zle-buffer() { *'an alias'*) style=$ZLE_ALIAS_STYLE;; *'shell builtin'*) style=$ZLE_BUILTIN_STYLE;; *'shell function'*) style=$ZLE_FUNCTION_STYLE;; - *"$cmd is"*) style=$ZLE_COMMAND_STYLE;; + *"${cmd:-no-command-specified} is"*) style=$ZLE_COMMAND_STYLE;; *) style=$ZLE_COMMAND_UNKNOWN_TOKEN_STYLE _check_path && style=$ZLE_PATH_STYLE