'main': Fix the $CDPATH from the previous commit.

This commit is contained in:
Daniel Shahaf 2020-01-12 19:37:53 +00:00
parent 6629a1f432
commit 08edf8db7f
2 changed files with 7 additions and 5 deletions

View File

@ -986,10 +986,12 @@ _zsh_highlight_main_highlighter_check_path()
[[ -e $expanded_path ]] && return 0 [[ -e $expanded_path ]] && return 0
# Search the path in CDPATH # Search the path in CDPATH
local cdpath_dir if [[ $expanded_path != /* ]]; then
for cdpath_dir in $cdpath ; do local cdpath_dir
[[ -e "$cdpath_dir/$expanded_path" ]] && return 0 for cdpath_dir in $cdpath ; do
done [[ -e "$cdpath_dir/$expanded_path" ]] && return 0
done
fi
# If dirname($1) doesn't exist, neither does $1. # If dirname($1) doesn't exist, neither does $1.
[[ ! -d ${expanded_path:h} ]] && return 1 [[ ! -d ${expanded_path:h} ]] && return 1

View File

@ -34,5 +34,5 @@ mkdir foo foo/bar
BUFFER="/foo" BUFFER="/foo"
expected_region_highlight=( expected_region_highlight=(
'1 4 unknown-token "fixed in the next commit"' # x (/) '1 4 unknown-token' # x (/)
) )