mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
Merge fccfc69b82 into 5eb677bb0f
This commit is contained in:
commit
e567bd07c2
2 changed files with 51 additions and 2 deletions
|
|
@ -1510,10 +1510,13 @@ _zsh_highlight_main_highlighter_highlight_double_quote()
|
|||
;;
|
||||
('$') style=dollar-double-quoted-argument
|
||||
# Look for an alphanumeric parameter name.
|
||||
if [[ ${arg:$i} =~ ^([A-Za-z_][A-Za-z0-9_]*|[0-9]+) ]] ; then
|
||||
local alphanumeric_parameter_name='[A-Za-z_][A-Za-z0-9_]*|[0-9]+'
|
||||
# :gs,:s,:F,:W take an argument between delimiters; we don't currently highlight delimiters.
|
||||
local history_modifiers=':[aAcehlpPqQ&tuxfw]|:gs.|:s.|:F.|:W.'
|
||||
if [[ ${arg:$i} =~ ^(${alphanumeric_parameter_name})(${history_modifiers})* ]] ; then
|
||||
(( k += $#MATCH )) # highlight the parameter name
|
||||
(( i += $#MATCH )) # skip past it
|
||||
elif [[ ${arg:$i} =~ ^[{]([A-Za-z_][A-Za-z0-9_]*|[0-9]+)[}] ]] ; then
|
||||
elif [[ ${arg:$i} =~ ^[{](${alphanumeric_parameter_name})(${history_modifiers})*[}] ]] ; then
|
||||
(( k += $#MATCH )) # highlight the parameter name and braces
|
||||
(( i += $#MATCH )) # skip past it
|
||||
elif [[ $arg[i+1] == '$' ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue