fixup! 'main': Don't match redirection operators in command substitutions as <-> number range globs. Fixes #483.

This commit is contained in:
Daniel Shahaf 2018-01-19 00:51:11 +00:00
parent 1c4ad6b6dc
commit e86138474e
2 changed files with 6 additions and 6 deletions

View File

@ -822,7 +822,7 @@ _zsh_highlight_main_highlighter_highlight_argument()
elif [[ $arg[i+1] == [*@#?-$!] ]]; then
(( i += 1 ))
fi;;
[*?]*|\<[0-9]#-[0-9]#\>)
[*?]*|\<[0-9]#-[0-9]#\>*)
# The '<' is for the <-> globbing syntax. (This function doesn't get called on redirection tokens.)
if $highlight_glob; then
_zsh_highlight_main_add_region_highlight $start_pos $end_pos globbing

View File

@ -28,13 +28,13 @@
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------
BUFFER='print <-> x<-> <foo2-3>'
BUFFER='print <-> x<->y <foo2-3>'
expected_region_highlight=(
'1 5 builtin' # print
'7 9 globbing' # <->
'11 14 globbing' # x<->
'16 16 redirection' # <
'17 22 default' # foo2-3 (the filename)
'23 23 redirection' # >
'11 15 globbing' # x<->
'17 17 redirection' # <
'18 23 default' # foo2-3 (the filename)
'24 24 redirection' # >
)