next try. fix for issue #76 without brakeing fix for #21

This commit is contained in:
Andreas Gahr 2011-09-22 21:18:24 +08:00 committed by Julien Nicoulaud
parent 8d4cde6301
commit 024c1c46f7

View File

@ -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
}