From 024c1c46f734207272abe275bba94e10a4a95c7f Mon Sep 17 00:00:00 2001 From: Andreas Gahr Date: Thu, 22 Sep 2011 21:18:24 +0800 Subject: [PATCH] next try. fix for issue #76 without brakeing fix for #21 --- highlighters/main/main-highlighter.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 4ec8353..708a501 100755 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -153,11 +153,12 @@ _zsh_highlight_main_highlighter_check_assign() # Check if the argument is a path. _zsh_highlight_main_highlighter_check_path() { + setopt nonomatch local expanded_path; : ${expanded_path:=${(Q)~arg}} - [[ -z "$expanded_path" ]] && return 1 - [[ -e "$expanded_path" ]] && return 0 - [[ ! -e "${expanded_path:h}" ]] && return 1 - [[ ${BUFFER[1]} != "-" && ${#BUFFER} == $end_pos && -n $(print "${expanded_path}"*(N)) ]] && return 0 + [[ -z $expanded_path ]] && return 1 + [[ -e $expanded_path ]] && return 0 + [[ ! -e ${expanded_path:h} ]] && return 1 + [[ ${BUFFER[1]} != "-" && ${#BUFFER} == $end_pos && -n $(print ${expanded_path}*(N)) ]] && return 0 return 1 }