I’m trying to add syntax highlighting for arguments with patterns similar to this:
if(GetKey(KEY_SPACE) == KEY_PRESSED)
where a KEY_ match should be highlighted, but only when inside GetKey.
I’ve tried creating a syntax rule for the top level:
syn match GetKey /(^|s|()GetKey((KEY_[_a-zA-Z0-9]+))($|s)/ contains=GetKeyArg contained
and then tried to match the insides of the brackets
syn match GetKeyArg /(KEY_[_a-zA-Z0-9]+)/ contained containedin=GetKey
but both KEY_SPACE
and KEY_PRESSED
become GetKeyArg. Is there a way to make a syntax match exclusive to a group?
New contributor
Aceldama is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.