parent
d6586e2a4f
commit
47c2b7e185
@ -33,7 +33,11 @@ This highlighter defines the following styles:
|
||||
* `globbing` - globbing expressions (`*.txt`)
|
||||
* `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`)
|
||||
* `command-substitution` - command substitutions (`$(echo foo)`)
|
||||
* `command-substitution-unquoted` - an unquoted command substitution (`$(echo foo)`)
|
||||
* `command-substitution-quoted` - a quoted command substitution (`"$(echo foo)"`)
|
||||
* `command-substitution-delimiter` - command substitution delimiters (`$(` and `)`)
|
||||
* `command-substitution-delimiter-unquoted` - an unquoted command substitution delimiters (`$(` and `)`)
|
||||
* `command-substitution-delimiter-quoted` - a quoted command substitution delimiters (`"$(` and `)"`)
|
||||
* `process-substitution` - process substitutions (`<(echo foo)`)
|
||||
* `process-substitution-delimiter` - process substitution delimiters (`<(` and `)`)
|
||||
* `single-hyphen-option` - single-hyphen options (`-o`)
|
||||
|
@ -107,6 +107,9 @@ _zsh_highlight_main_calculate_fallback() {
|
||||
dollar-quoted-argument{-unclosed,}
|
||||
back-quoted-argument{-unclosed,}
|
||||
|
||||
command-substitution{-quoted,,-unquoted,}
|
||||
command-substitution-delimiter{-quoted,,-unquoted,}
|
||||
|
||||
command-substitution{-delimiter,}
|
||||
process-substitution{-delimiter,}
|
||||
back-quoted-argument{-delimiter,}
|
||||
@ -1015,12 +1018,12 @@ _zsh_highlight_main_highlighter_highlight_argument()
|
||||
ret=$?
|
||||
(( i += REPLY ))
|
||||
highlights+=(
|
||||
$(( start_pos + start - 1)) $(( start_pos + i )) command-substitution
|
||||
$(( start_pos + start - 1)) $(( start_pos + start + 1)) command-substitution-delimiter
|
||||
$(( start_pos + start - 1)) $(( start_pos + i )) command-substitution-unquoted
|
||||
$(( start_pos + start - 1)) $(( start_pos + start + 1)) command-substitution-delimiter-unquoted
|
||||
$reply
|
||||
)
|
||||
if (( ret == 0 )); then
|
||||
highlights+=($(( start_pos + i - 1)) $(( start_pos + i )) command-substitution-delimiter)
|
||||
highlights+=($(( start_pos + i - 1)) $(( start_pos + i )) command-substitution-delimiter-unquoted)
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
@ -1147,12 +1150,12 @@ _zsh_highlight_main_highlighter_highlight_double_quote()
|
||||
(( i += REPLY ))
|
||||
reply=(
|
||||
$saved_reply
|
||||
$j $(( start_pos + i )) command-substitution
|
||||
$j $(( j + 2 )) command-substitution-delimiter
|
||||
$j $(( start_pos + i )) command-substitution-quoted
|
||||
$j $(( j + 2 )) command-substitution-delimiter-quoted
|
||||
$reply
|
||||
)
|
||||
if (( ret == 0 )); then
|
||||
reply+=($(( start_pos + i - 1 )) $(( start_pos + i )) command-substitution-delimiter)
|
||||
reply+=($(( start_pos + i - 1 )) $(( start_pos + i )) command-substitution-delimiter-quoted)
|
||||
fi
|
||||
continue
|
||||
else
|
||||
|
@ -33,10 +33,10 @@ BUFFER=$'foo=$(echo bar) :'
|
||||
expected_region_highlight=(
|
||||
'1 15 assign' # foo=$(echo bar)
|
||||
'5 15 default' # $(echo bar)
|
||||
'5 15 command-substitution' # $(echo bar)
|
||||
'5 6 command-substitution-delimiter' # $(
|
||||
'5 15 command-substitution-unquoted' # $(echo bar)
|
||||
'5 6 command-substitution-delimiter-unquoted' # $(
|
||||
'7 10 builtin' # echo
|
||||
'12 14 default' # bar
|
||||
'15 15 command-substitution-delimiter' # )
|
||||
'15 15 command-substitution-delimiter-unquoted' # )
|
||||
'17 17 builtin' # :
|
||||
)
|
||||
|
@ -33,8 +33,8 @@ BUFFER=$': foo$(echo bar'
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 15 default' # foo$(echo bar
|
||||
'6 15 command-substitution' # $(echo bar
|
||||
'6 7 command-substitution-delimiter' # $(
|
||||
'6 15 command-substitution-unquoted' # $(echo bar
|
||||
'6 7 command-substitution-delimiter-unquoted' # $(
|
||||
'8 11 builtin' # echo
|
||||
'13 15 default' # bar
|
||||
)
|
||||
|
@ -53,8 +53,8 @@ expected_region_highlight=(
|
||||
'55 58 double-quoted-argument-unclosed' # "lhu
|
||||
'59 62 back-quoted-argument-delimiter' # \\\`
|
||||
'64 112 default' # R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
|
||||
'70 109 command-substitution' # $(echo eh wag\\\`echo h\'nag\\\`'l' fht)
|
||||
'70 71 command-substitution-delimiter' # $(
|
||||
'70 109 command-substitution-unquoted' # $(echo eh wag\\\`echo h\'nag\\\`'l' fht)
|
||||
'70 71 command-substitution-delimiter-unquoted' # $(
|
||||
'72 75 builtin' # echo
|
||||
'77 78 default' # eh
|
||||
'80 104 default' # wag\\\`echo h\'nag\\\`'l'
|
||||
@ -65,6 +65,6 @@ expected_region_highlight=(
|
||||
'98 101 back-quoted-argument-delimiter' # \\\`
|
||||
'102 104 single-quoted-argument' # 'l'
|
||||
'106 108 default' # fht
|
||||
'109 109 command-substitution-delimiter' # )
|
||||
'109 109 command-substitution-delimiter-unquoted' # )
|
||||
'113 113 unknown-token' # `
|
||||
)
|
||||
|
@ -34,8 +34,8 @@ expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 8 default' # "$(:)"
|
||||
'3 8 double-quoted-argument' # "$(:)"
|
||||
'4 7 command-substitution' # $(:)
|
||||
'4 5 command-substitution-delimiter' # $(
|
||||
'4 7 command-substitution-quoted' # $(:)
|
||||
'4 5 command-substitution-delimiter-quoted' # $(
|
||||
'6 6 builtin' # :
|
||||
'7 7 command-substitution-delimiter' # )
|
||||
'7 7 command-substitution-delimiter-quoted' # )
|
||||
)
|
||||
|
@ -33,9 +33,9 @@ BUFFER=$': $(<foo)'
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 9 default' # $(<foo)
|
||||
'3 9 command-substitution' # $(<foo)
|
||||
'3 4 command-substitution-delimiter' # $(
|
||||
'3 9 command-substitution-unquoted' # $(<foo)
|
||||
'3 4 command-substitution-delimiter-unquoted' # $(
|
||||
'5 5 redirection' # <
|
||||
'6 8 default' # foo
|
||||
'9 9 command-substitution-delimiter' # )
|
||||
'9 9 command-substitution-delimiter-unquoted' # )
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user