main: Highlight =( ) process substitutions

This commit is contained in:
Matthew Martin 2018-03-14 22:47:33 -05:00
parent 73640b79ea
commit c0e64fe131
2 changed files with 12 additions and 2 deletions

View file

@ -842,7 +842,7 @@ _zsh_highlight_main_highlighter_check_path()
# This command will at least highlight start_pos to end_pos with the default style # This command will at least highlight start_pos to end_pos with the default style
_zsh_highlight_main_highlighter_highlight_argument() _zsh_highlight_main_highlighter_highlight_argument()
{ {
local base_style=default i path_eligible=1 start style local base_style=default i=1 path_eligible=1 start style
local -a highlights local -a highlights
local -a match mbegin mend local -a match mbegin mend
@ -857,9 +857,16 @@ _zsh_highlight_main_highlighter_highlight_argument()
fi fi
path_eligible=0 path_eligible=0
;; ;;
'=')
if [[ $arg[2] == $'\x28' ]]; then
(( i += 2 ))
_zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos]
(( i += REPLY ))
highlights+=($start_pos $(( start_pos + i )) process-substitution $reply)
fi
esac esac
for (( i = 1 ; i <= end_pos - start_pos ; i += 1 )); do for (( ; i <= end_pos - start_pos ; i += 1 )); do
case "$arg[$i]" in case "$arg[$i]" in
"\\") (( i += 1 )); continue;; "\\") (( i += 1 )); continue;;
"'") "'")

View file

@ -33,4 +33,7 @@ BUFFER=$': =(<foo)'
expected_region_highlight=( expected_region_highlight=(
'1 1 builtin' # : '1 1 builtin' # :
'3 9 default' # =(<foo) '3 9 default' # =(<foo)
'3 9 process-substitution' # =(<foo)
'5 5 redirection' # <foo
'6 8 default' # foo
) )