Allow for empty patterns

This commit is contained in:
Joe Rabinoff 2020-02-14 07:32:17 -05:00 committed by GitHub
parent 3e1413eaf1
commit e80505a73e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,7 +108,7 @@ zsh_highlight_files_extract_ls_colors()
{
local -A ls_colors
_zsh_highlight_highlighter_files_ansi_to_zle ls_colors $LS_COLORS
for key val in ${(kv)ls_colors}; do
for key val in "${(@kv)ls_colors}"; do
case $key in
di|fi|ln|pi|so|bd|cd|or|ex|su|sg|ow|tw)
ZSH_HIGHLIGHT_FILE_TYPES[$key]=$val ;;
@ -202,7 +202,7 @@ _zsh_highlight_highlighter_files_paint()
# Regular file: check file patterns
if [[ -z "$col" ]]; then
for key val in ${(kv)ZSH_HIGHLIGHT_FILE_PATTERNS}; do
for key val in "${(@kv)ZSH_HIGHLIGHT_FILE_PATTERNS}"; do
if [[ $basename = $~key ]]; then
col=$val
break