mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2026-06-19 01:12:48 +02:00
main: support highlighting paths with specific styles
If there are styles starting with `*.`, consider these "glob matchers" and style according to the matching glob. This allows users to color paths matching patterns in any way desired. Fixes: #605
This commit is contained in:
parent
99680ff695
commit
f39e4bbdfb
3 changed files with 19 additions and 0 deletions
|
|
@ -1258,6 +1258,16 @@ _zsh_highlight_main_highlighter_check_path()
|
|||
fi
|
||||
else
|
||||
if [[ -L $expanded_path || -e $expanded_path ]]; then
|
||||
for key in ${(k)ZSH_HIGHLIGHT_STYLES}; do
|
||||
case $key in
|
||||
"*."*) ;;
|
||||
*) continue ;;
|
||||
esac
|
||||
case $arg in
|
||||
*.$key[3,-1]) REPLY=$key ;;
|
||||
esac
|
||||
done
|
||||
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue