Highlight subshells and anonymous functions correctly.
Fixes zsh-users/zsh-syntax-highlighting#166. Fixes zsh-users/zsh-syntax-highlighting#194. Builds upon the issue #207 work.
This commit is contained in:
@@ -30,11 +30,11 @@
|
||||
BUFFER='() echo hello; () { echo world }'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word] 'issue #194'" # ()
|
||||
"4 7 $ZSH_HIGHLIGHT_STYLES[command] 'issue #194'" # echo
|
||||
"1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ()
|
||||
"4 7 $ZSH_HIGHLIGHT_STYLES[command]" # echo
|
||||
"9 13 $ZSH_HIGHLIGHT_STYLES[default]" # hello
|
||||
"14 14 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
|
||||
"16 17 $ZSH_HIGHLIGHT_STYLES[reserved-word] 'issue #194'" # ()
|
||||
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word] 'issue #194'" # {
|
||||
"21 24 $ZSH_HIGHLIGHT_STYLES[command] 'issue #194'" # echo
|
||||
"16 17 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # ()
|
||||
"19 19 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # {
|
||||
"21 24 $ZSH_HIGHLIGHT_STYLES[command]" # echo
|
||||
)
|
||||
|
||||
@@ -31,6 +31,6 @@ BUFFER='tar cf - * | (cd /target; tar xfp -)'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 3 $ZSH_HIGHLIGHT_STYLES[command]" # tar
|
||||
"15 16 $ZSH_HIGHLIGHT_STYLES[command] 'issue #166'" # cd
|
||||
"15 16 $ZSH_HIGHLIGHT_STYLES[command]" # cd
|
||||
"27 29 $ZSH_HIGHLIGHT_STYLES[command]" # tar
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user