I’m trying to create a new syntax definition for the Ruby mote templates. They’re pretty straight forward and are really similar to ERB in that they are just Ruby code embedded in some HTML.
In a syntax definition, how do you tell Sublime to highlight a match like it’s another language? I have the following:
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Mote
scopeName: text.html.mote
fileTypes: [mote]
uuid: 0091dcd2-99e8-4211-b199-a3ffb5bcffff
patterns:
- include: text.html.basic
- comment: Ruby in {{}}
match: \{\{(.*?)\}\}
name: text.html.mote.inline
captures:
'1': { name: source.ruby }
- comment: Ruby lines that start with %
match: ^[^\S\n]*%[^\S\n]*(.*?)(?:\n|\Z)
name: text.html.mote.line
captures:
'1': { name: source.ruby }
It seems to pick up the matches correctly, but it doesn’t highlight the captured Ruby code completely.
Any help would be much appreciated, thank you!