*highlight: Allow in-string ${...} to contain flags like: (z@)

This commit is contained in:
Sebastian Gniazdowski 2016-10-15 11:20:04 +02:00
parent 9e8148083c
commit ecc4a34a7e

View file

@ -689,7 +689,7 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
if [[ ${arg:$i} = (#b)([[:alpha:]_][[:alnum:]_]#|[[:digit:]]##)* ]] ; then
(( k += ${#match[1]} )) # highlight the parameter name
(( i += ${#match[1]} )) # skip past it
elif [[ ${arg:$i} = (#b)([{]([[:alpha:]_][[:alnum:]_]#|[[:digit:]]##)[}])* ]] ; then
elif [[ ${arg:$i} = (#b)([{](\([a-zA-Z0@]##\))(#c0,1)([[:alpha:]_][[:alnum:]_]#|[[:digit:]]##)[}])* ]] ; then
(( k += ${#match[1]} )) # highlight the parameter name and braces
(( i += ${#match[1]} )) # skip past it
else