mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
Update main-highlighter.zsh
Add support of CDPATH
This commit is contained in:
parent
e5d8a50d36
commit
57c01d19de
1 changed files with 4 additions and 0 deletions
|
|
@ -158,6 +158,10 @@ _zsh_highlight_main_highlighter_check_path()
|
||||||
local expanded_path; : ${expanded_path:=${(Q)~arg}}
|
local expanded_path; : ${expanded_path:=${(Q)~arg}}
|
||||||
[[ -z $expanded_path ]] && return 1
|
[[ -z $expanded_path ]] && return 1
|
||||||
[[ -e $expanded_path ]] && return 0
|
[[ -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
|
[[ ! -e ${expanded_path:h} ]] && return 1
|
||||||
[[ ${BUFFER[1]} != "-" && ${#BUFFER} == $end_pos && -n $(print ${expanded_path}*(N)) ]] && return 0
|
[[ ${BUFFER[1]} != "-" && ${#BUFFER} == $end_pos && -n $(print ${expanded_path}*(N)) ]] && return 0
|
||||||
return 1
|
return 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue