根据您的定义,我看到您有:
syn region swgInside start=/{(%|{)/ end=/(%|})}/ keepend transparent containedin=@htmlSwgContainer
syn match swgBrackets "{%\|%}\|{{\|}}" containedin=swgInside
然而,在你发布的截图中,我没有看到swgBrackets包含在swgInside块中(其中我看到两个块:{% if ... %}
和{% endif %}
)。
我建议修改swgBrackets的限制条件(也许删除containedin?)。 这可能会有所帮助: Vim语法文件...试图理解“包含”