From 57c01d19deff8a9f4240af7e3cd67ace90947394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80?= Date: Wed, 7 Aug 2013 03:21:15 +0300 Subject: [PATCH] Update main-highlighter.zsh Add support of CDPATH --- highlighters/main/main-highlighter.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index be1d0a9..e8cf782 100755 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -158,6 +158,10 @@ _zsh_highlight_main_highlighter_check_path() local expanded_path; : ${expanded_path:=${(Q)~arg}} [[ -z $expanded_path ]] && return 1 [[ -e $expanded_path ]] && return 0 + # Search the path in CDPATH + for cdpath_dir in $cdpath ; do + [[ -e "$cdpath_dir/$expanded_path" ]] && return 0 + done [[ ! -e ${expanded_path:h} ]] && return 1 [[ ${BUFFER[1]} != "-" && ${#BUFFER} == $end_pos && -n $(print ${expanded_path}*(N)) ]] && return 0 return 1