mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
parent
90b09f88ee
commit
6713727742
3 changed files with 61 additions and 1 deletions
|
|
@ -757,7 +757,7 @@ _zsh_highlight_main_highlighter_highlight_path_separators()
|
|||
_zsh_highlight_main_highlighter_check_path()
|
||||
{
|
||||
_zsh_highlight_main_highlighter_expand_path $arg;
|
||||
local expanded_path="$REPLY"
|
||||
local expanded_path="$REPLY" tmp_path
|
||||
|
||||
REPLY=path
|
||||
|
||||
|
|
@ -765,6 +765,19 @@ _zsh_highlight_main_highlighter_check_path()
|
|||
[[ -L $expanded_path ]] && return 0
|
||||
[[ -e $expanded_path ]] && return 0
|
||||
|
||||
# Check if this is a blacklisted path
|
||||
if [[ $expanded_path[1] == / ]]; then
|
||||
tmp_path=$expanded_path
|
||||
else
|
||||
tmp_path=$PWD/$expanded_path
|
||||
fi
|
||||
tmp_path=$tmp_path:a
|
||||
|
||||
while [[ $tmp_path != / ]]; do
|
||||
[[ -n "${(M)ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path}" ]] && return 1
|
||||
tmp_path=$tmp_path:h
|
||||
done
|
||||
|
||||
# Search the path in CDPATH
|
||||
local cdpath_dir
|
||||
for cdpath_dir in $cdpath ; do
|
||||
|
|
@ -1070,3 +1083,4 @@ else
|
|||
# Make sure the cache is unset
|
||||
unset _zsh_highlight_main__command_type_cache
|
||||
fi
|
||||
typeset -ga ZSH_HIGHLIGHT_DIRS_BLACKLIST
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue