mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-06 09:55:31 +08:00
Allow for empty patterns
This commit is contained in:
parent
3e1413eaf1
commit
e80505a73e
@ -108,7 +108,7 @@ zsh_highlight_files_extract_ls_colors()
|
|||||||
{
|
{
|
||||||
local -A ls_colors
|
local -A ls_colors
|
||||||
_zsh_highlight_highlighter_files_ansi_to_zle ls_colors $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
|
case $key in
|
||||||
di|fi|ln|pi|so|bd|cd|or|ex|su|sg|ow|tw)
|
di|fi|ln|pi|so|bd|cd|or|ex|su|sg|ow|tw)
|
||||||
ZSH_HIGHLIGHT_FILE_TYPES[$key]=$val ;;
|
ZSH_HIGHLIGHT_FILE_TYPES[$key]=$val ;;
|
||||||
@ -202,7 +202,7 @@ _zsh_highlight_highlighter_files_paint()
|
|||||||
|
|
||||||
# Regular file: check file patterns
|
# Regular file: check file patterns
|
||||||
if [[ -z "$col" ]]; then
|
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
|
if [[ $basename = $~key ]]; then
|
||||||
col=$val
|
col=$val
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user