fixup! 'main': Fix highlighting of «<->»-style numeric globs.

This commit is contained in:
Daniel Shahaf 2017-12-23 21:04:39 +00:00
parent 07e2c7ceea
commit 35270f7c97
2 changed files with 4 additions and 3 deletions

View File

@ -163,7 +163,7 @@ _zsh_highlight_main__is_redirection() {
# - then, has a '<' or '>' character; # - then, has a '<' or '>' character;
# - is not a process substitution [<(...) or >(...)]. # - is not a process substitution [<(...) or >(...)].
# - is not a numeric glob <-> # - is not a numeric glob <->
[[ $1 == (<0-9>|)(\<|\>)* ]] && [[ $1 != (\<|\>)$'\x28'* ]] && [[ $1 != '<'*'-'*'>' ]] [[ $1 == (<0-9>|)(\<|\>)* ]] && [[ $1 != (\<|\>)$'\x28'* ]] && [[ $1 != *'<'*'-'*'>'* ]]
} }
# Resolve alias. # Resolve alias.
@ -683,7 +683,7 @@ _zsh_highlight_highlighter_main_paint()
;; ;;
'`'*) style=back-quoted-argument;; '`'*) style=back-quoted-argument;;
[$][*]) style=default;; [$][*]) style=default;;
[*?]*|*[^\\][*?]*|'<'*'-'*'>') [*?]*|*[^\\][*?]*|*'<'*'-'*'>'*)
$highlight_glob && style=globbing || style=default;; $highlight_glob && style=globbing || style=default;;
*) if false; then *) if false; then
elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then elif [[ $arg = $'\x7d' ]] && $right_brace_is_recognised_everywhere; then

View File

@ -28,9 +28,10 @@
# vim: ft=zsh sw=2 ts=2 et # vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------
BUFFER=$'print <->' BUFFER=$'print <-> 0<->'
expected_region_highlight=( expected_region_highlight=(
'1 5 builtin' # print '1 5 builtin' # print
'7 9 globbing' # <-> '7 9 globbing' # <->
'11 14 globbing' # 0<->
) )