Don't highlight escaped globbing.

Fixes zsh-users/zsh-syntax-highlighting#193.
This commit is contained in:
Daniel Shahaf 2015-09-29 23:44:57 +00:00
commit 69203b1a1d
2 changed files with 5 additions and 2 deletions

View File

@ -226,7 +226,8 @@ _zsh_highlight_main_highlighter()
substr_color=1
;;
'`'*) style=$ZSH_HIGHLIGHT_STYLES[back-quoted-argument];;
*[*?]*) $highlight_glob && style=$ZSH_HIGHLIGHT_STYLES[globbing] || style=$ZSH_HIGHLIGHT_STYLES[default];;
[*?]*|*[^\\][*?]*)
$highlight_glob && style=$ZSH_HIGHLIGHT_STYLES[globbing] || style=$ZSH_HIGHLIGHT_STYLES[default];;
*) if false; then
elif [[ $arg[0,1] = $histchars[0,1] ]]; then
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]

View File

@ -28,10 +28,12 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
BUFFER=': foo* bar?'
BUFFER=': foo* bar? *baz qux\?'
expected_region_highlight=(
"1 1 $ZSH_HIGHLIGHT_STYLES[builtin]" # :
"3 6 $ZSH_HIGHLIGHT_STYLES[globbing]" # foo*
"8 11 $ZSH_HIGHLIGHT_STYLES[globbing]" # bar?
"13 16 $ZSH_HIGHLIGHT_STYLES[globbing]" # *baz
"18 22 $ZSH_HIGHLIGHT_STYLES[default]" # qux\?
)