I am having an issue, which I was able to reduce to the following sequence of commands:
setf c
syntax region templatyExpression matchgroup=Special start='{{' end='}}'
syntax region templatyStatement matchgroup=Special start='{%' end='%}'
syntax match templatyIdentifier '\v[a-zA-Z][a-zA-Z0-9]*' contained containedin=templatyStatement,templatyExpression
From the moment I type the last command, the following C code is improperly highlighted in a test file:
#define FOO 1
mdddddd ddd n
Where m stands for macro-coloured highlighting, d for default highlighting and n for the highlighting associated with numbers.
My question is: why is that? From what I have understood, contained
, together with containedin
, should only apply the highlighter when within something like {{ foo }}
and leave everything else untouched. The rest of my highlighting code works as expected. Is there something obvious I'm missing?