mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
'main': Highlight the parentheses of array assignments as reserved words.
Fixes #585.
This commit is contained in:
parent
00c0c76550
commit
0f11d80968
13 changed files with 28 additions and 1 deletions
|
|
@ -1007,6 +1007,7 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
saw_assignment=true
|
||||
if [[ $arg[i] == '(' ]]; then
|
||||
in_array_assignment=true
|
||||
_zsh_highlight_main_add_region_highlight start_pos+i-1 start_pos+i reserved-word
|
||||
else
|
||||
# assignment to a scalar parameter.
|
||||
# (For array assignments, the command doesn't start until the ")" token.)
|
||||
|
|
@ -1088,9 +1089,11 @@ _zsh_highlight_main_highlighter_highlight_list()
|
|||
($'\x29')
|
||||
# subshell or end of array assignment
|
||||
if $in_array_assignment; then
|
||||
style=assign
|
||||
_zsh_highlight_main_add_region_highlight $start_pos $end_pos assign
|
||||
_zsh_highlight_main_add_region_highlight $start_pos $end_pos reserved-word
|
||||
in_array_assignment=false
|
||||
next_word+=':start:'
|
||||
continue
|
||||
elif (( in_redirection )); then
|
||||
style=unknown-token
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue