Browse Source

Merge pull request #529 from wraeth/master

main: Probe dirs after blacklist
pull/533/head
Matthew Martin 6 years ago
committed by GitHub
parent
commit
683321d862
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions
  1. +3
    -2
      highlighters/main/main-highlighter.zsh
  2. +2
    -2
      highlighters/main/test-data/dirs_blacklist.zsh

+ 3
- 2
highlighters/main/main-highlighter.zsh View File

@ -761,8 +761,6 @@ _zsh_highlight_main_highlighter_check_path()
REPLY=path REPLY=path
[[ -z $expanded_path ]] && return 1 [[ -z $expanded_path ]] && return 1
[[ -L $expanded_path ]] && return 0
[[ -e $expanded_path ]] && return 0
# Check if this is a blacklisted path # Check if this is a blacklisted path
if [[ $expanded_path[1] == / ]]; then if [[ $expanded_path[1] == / ]]; then
@ -777,6 +775,9 @@ _zsh_highlight_main_highlighter_check_path()
tmp_path=$tmp_path:h tmp_path=$tmp_path:h
done done
[[ -L $expanded_path ]] && return 0
[[ -e $expanded_path ]] && return 0
# Search the path in CDPATH # Search the path in CDPATH
local cdpath_dir local cdpath_dir
for cdpath_dir in $cdpath ; do for cdpath_dir in $cdpath ; do

+ 2
- 2
highlighters/main/test-data/dirs_blacklist.zsh View File

@ -34,7 +34,7 @@ X_ZSH_HIGHLIGHT_DIRS_BLACKLIST=($PWD/foo)
expected_region_highlight=( expected_region_highlight=(
'1 1 builtin' # : '1 1 builtin' # :
'3 9 path' # foo/bar
"11 $(( 14 + $#PWD )) path" # $PWD/foo
'3 9 default' # foo/bar
"11 $(( 14 + $#PWD )) default" # $PWD/foo
"$(( 16 + $#PWD )) $(( 20 + $#PWD )) default" # foo/b "$(( 16 + $#PWD )) $(( 20 + $#PWD )) default" # foo/b
) )

Loading…
Cancel
Save