File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1085,6 +1085,12 @@ _zsh_highlight_main_highlighter_check_path()
1085
1085
local expanded_path=" $REPLY " tmp_path
1086
1086
integer in_command_position=$2
1087
1087
1088
+ if [[ $zsyh_user_options [autocd] == on ]]; then
1089
+ integer autocd=1
1090
+ else
1091
+ integer autocd=0
1092
+ fi
1093
+
1088
1094
if (( in_command_position )) ; then
1089
1095
REPLY=arg0
1090
1096
else
@@ -1107,7 +1113,7 @@ _zsh_highlight_main_highlighter_check_path()
1107
1113
done
1108
1114
1109
1115
if (( in_command_position )) ; then
1110
- if [[ -x $expanded_path ]] && [[ $zsyh_user_options [ autocd] == on || ! -d $expanded_path ]]; then
1116
+ if [[ -x $expanded_path ]] && { (( autocd )) || [[ ! -d $expanded_path ]] } ; then
1111
1117
return 0
1112
1118
fi
1113
1119
else
@@ -1117,8 +1123,7 @@ _zsh_highlight_main_highlighter_check_path()
1117
1123
fi
1118
1124
1119
1125
# Search the path in CDPATH
1120
- if [[ $expanded_path != /* ]] &&
1121
- { (( ! in_command_position )) || [[ $zsyh_user_options [autocd] == on ]] }; then
1126
+ if [[ $expanded_path != /* ]] && (( autocd || ! in_command_position )) ; then
1122
1127
# TODO: When we've dropped support for pre-5.0.6 zsh, use the *(Y1) glob qualifier here.
1123
1128
local cdpath_dir
1124
1129
for cdpath_dir in $cdpath ; do
You can’t perform that action at this time.
0 commit comments