Skip to content

Commit 08edf8d

Browse files
committed
'main': Fix the $CDPATH from the previous commit.
1 parent 6629a1f commit 08edf8d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

highlighters/main/main-highlighter.zsh

+6-4
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,12 @@ _zsh_highlight_main_highlighter_check_path()
986986
[[ -e $expanded_path ]] && return 0
987987

988988
# Search the path in CDPATH
989-
local cdpath_dir
990-
for cdpath_dir in $cdpath ; do
991-
[[ -e "$cdpath_dir/$expanded_path" ]] && return 0
992-
done
989+
if [[ $expanded_path != /* ]]; then
990+
local cdpath_dir
991+
for cdpath_dir in $cdpath ; do
992+
[[ -e "$cdpath_dir/$expanded_path" ]] && return 0
993+
done
994+
fi
993995

994996
# If dirname($1) doesn't exist, neither does $1.
995997
[[ ! -d ${expanded_path:h} ]] && return 1

highlighters/main/test-data/cdpath-abspath.zsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ mkdir foo foo/bar
3434
BUFFER="/foo"
3535

3636
expected_region_highlight=(
37-
'1 4 unknown-token "fixed in the next commit"' # x (/)
37+
'1 4 unknown-token' # x (/)
3838
)

0 commit comments

Comments
 (0)