main: Drop X_ from X_ZSH_HIGHLIGHT_DIRS_BLACKLIST

This commit is contained in:
Matthew Martin 2019-07-24 07:27:54 -05:00
parent 8e78e9dbba
commit b55832c5f8
4 changed files with 17 additions and 5 deletions

View file

@ -85,11 +85,11 @@ manual page][zshzle-Character-Highlighting].
#### Parameters
To avoid partial path lookups on a path, add the path to the `X_ZSH_HIGHLIGHT_DIRS_BLACKLIST` array.
To avoid partial path lookups on a path, add the path to the `ZSH_HIGHLIGHT_DIRS_BLACKLIST` array.
This interface is still experimental.
```zsh
X_ZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/slow_share)
ZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/slow_share)
```
### Useless trivia

View file

@ -355,6 +355,12 @@ _zsh_highlight_highlighter_main_paint()
'!' # reserved word; unrelated to $histchars[1]
)
if (( $+X_ZSH_HIGHLIGHT_DIRS_BLACKLIST )); then
print >&2 'zsh-syntax-highlighting: X_ZSH_HIGHLIGHT_DIRS_BLACKLIST is deprecated. Please use ZSH_HIGHLIGHT_DIRS_BLACKLIST.'
ZSH_HIGHLIGHT_DIRS_BLACKLIST=($X_ZSH_HIGHLIGHT_DIRS_BLACKLIST)
unset X_ZSH_HIGHLIGHT_DIRS_BLACKLIST
fi
_zsh_highlight_main_highlighter_highlight_list -$#PREBUFFER '' 1 "$PREBUFFER$BUFFER"
# end is a reserved word
@ -966,7 +972,7 @@ _zsh_highlight_main_highlighter_check_path()
tmp_path=$tmp_path:a
while [[ $tmp_path != / ]]; do
[[ -n ${(M)X_ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path} ]] && return 1
[[ -n ${(M)ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path} ]] && return 1
tmp_path=$tmp_path:h
done
@ -1411,4 +1417,4 @@ else
# Make sure the cache is unset
unset _zsh_highlight_main__command_type_cache
fi
typeset -ga X_ZSH_HIGHLIGHT_DIRS_BLACKLIST
typeset -ga ZSH_HIGHLIGHT_DIRS_BLACKLIST

View file

@ -30,7 +30,7 @@
mkdir foo
touch foo/bar
BUFFER=": foo/bar $PWD/foo foo/b"
X_ZSH_HIGHLIGHT_DIRS_BLACKLIST=($PWD/foo $PWD/bar)
ZSH_HIGHLIGHT_DIRS_BLACKLIST=($PWD/foo $PWD/bar)
expected_region_highlight=(
'1 1 builtin' # :

View file

@ -432,6 +432,12 @@ zmodload zsh/parameter 2>/dev/null || true
# Initialize the array of active highlighters if needed.
[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main)
if (( $+X_ZSH_HIGHLIGHT_DIRS_BLACKLIST )); then
print >&2 'zsh-syntax-highlighting: X_ZSH_HIGHLIGHT_DIRS_BLACKLIST is deprecated. Please use ZSH_HIGHLIGHT_DIRS_BLACKLIST.'
ZSH_HIGHLIGHT_DIRS_BLACKLIST=($X_ZSH_HIGHLIGHT_DIRS_BLACKLIST)
unset X_ZSH_HIGHLIGHT_DIRS_BLACKLIST
fi
# Restore the aliases we unned
eval "$zsh_highlight__aliases"
builtin unset zsh_highlight__aliases