Don't highlight escaped globbing.
Fixes zsh-users/zsh-syntax-highlighting#193.
This commit is contained in:
parent
6488284814
commit
52a2ef644b
@ -213,7 +213,8 @@ _zsh_highlight_main_highlighter()
|
|||||||
substr_color=1
|
substr_color=1
|
||||||
;;
|
;;
|
||||||
'`'*) style=$ZSH_HIGHLIGHT_STYLES[back-quoted-argument];;
|
'`'*) 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
|
*) if false; then
|
||||||
elif [[ $arg[0,1] = $histchars[0,1] ]]; then
|
elif [[ $arg[0,1] = $histchars[0,1] ]]; then
|
||||||
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]
|
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]
|
||||||
|
@ -28,10 +28,12 @@
|
|||||||
# vim: ft=zsh sw=2 ts=2 et
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
BUFFER=': foo* bar?'
|
BUFFER=': foo* bar? *baz qux\?'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"1 1 $ZSH_HIGHLIGHT_STYLES[builtin]" # :
|
"1 1 $ZSH_HIGHLIGHT_STYLES[builtin]" # :
|
||||||
"3 6 $ZSH_HIGHLIGHT_STYLES[globbing]" # foo*
|
"3 6 $ZSH_HIGHLIGHT_STYLES[globbing]" # foo*
|
||||||
"8 11 $ZSH_HIGHLIGHT_STYLES[globbing]" # bar?
|
"8 11 $ZSH_HIGHLIGHT_STYLES[globbing]" # bar?
|
||||||
|
"13 16 $ZSH_HIGHLIGHT_STYLES[globbing]" # *baz
|
||||||
|
"18 22 $ZSH_HIGHLIGHT_STYLES[default]" # qux\?
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user