This commit is contained in:
Daniel Shahaf 2018-01-19 00:51:21 +00:00 committed by GitHub
commit a55260a34e
3 changed files with 13 additions and 13 deletions

View File

@ -803,12 +803,12 @@ _zsh_highlight_main_highlighter_highlight_argument()
_zsh_highlight_main_add_region_highlight $start_pos $end_pos default _zsh_highlight_main_add_region_highlight $start_pos $end_pos default
for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do
case "$arg[$i]" in case ${arg:$i-1} in
"\\") (( i += 1 )); continue;; "\\"*) (( i += 1 )); continue;;
"'") _zsh_highlight_main_highlighter_highlight_single_quote $i; (( i = REPLY ));; "'"*) _zsh_highlight_main_highlighter_highlight_single_quote $i; (( i = REPLY ));;
'"') _zsh_highlight_main_highlighter_highlight_double_quote $i; (( i = REPLY ));; '"'*) _zsh_highlight_main_highlighter_highlight_double_quote $i; (( i = REPLY ));;
'`') _zsh_highlight_main_highlighter_highlight_backtick $i; (( i = REPLY ));; '`'*) _zsh_highlight_main_highlighter_highlight_backtick $i; (( i = REPLY ));;
'$') '$'*)
if [[ $arg[i+1] == "'" ]]; then if [[ $arg[i+1] == "'" ]]; then
_zsh_highlight_main_highlighter_highlight_dollar_quote $i _zsh_highlight_main_highlighter_highlight_dollar_quote $i
(( i = REPLY )) (( i = REPLY ))
@ -822,7 +822,7 @@ _zsh_highlight_main_highlighter_highlight_argument()
elif [[ $arg[i+1] == [*@#?-$!] ]]; then elif [[ $arg[i+1] == [*@#?-$!] ]]; then
(( i += 1 )) (( i += 1 ))
fi;; fi;;
[*?]|\<) [*?]*|\<[0-9]#-[0-9]#\>*)
# The '<' is for the <-> globbing syntax. (This function doesn't get called on redirection tokens.) # The '<' is for the <-> globbing syntax. (This function doesn't get called on redirection tokens.)
if $highlight_glob; then if $highlight_glob; then
_zsh_highlight_main_add_region_highlight $start_pos $end_pos globbing _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 # vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------
BUFFER='print <-> x<-> <foo2-3>' BUFFER='print <-> x<->y <foo2-3>'
expected_region_highlight=( expected_region_highlight=(
'1 5 builtin' # print '1 5 builtin' # print
'7 9 globbing' # <-> '7 9 globbing' # <->
'11 14 globbing' # x<-> '11 15 globbing' # x<->
'16 16 redirection' # < '17 17 redirection' # <
'17 22 default' # foo2-3 (the filename) '18 23 default' # foo2-3 (the filename)
'23 23 redirection' # > '24 24 redirection' # >
) )

View File

@ -32,5 +32,5 @@ BUFFER=$': $(<foo)'
expected_region_highlight=( expected_region_highlight=(
'1 1 builtin' # : '1 1 builtin' # :
'3 9 default "issue #483"' # $(<foo) '3 9 default' # $(<foo)
) )