In the bundle I've created I'm attempting to refine my scopes. Take the following example:
INT. SHIPYARD DOCKS - DAY
The above line falls under the scopes "text.splay.screenplay" (the document) and "splay.slugline" (the element). What I want is to be able to define the three separate elements: "INT", "SHIPYARD DOCKS", "DAY" as independent scopes, while retaining their status as "splay.slugline" So "INT" would fall under the jurisdiction of "text.splay.screenplay splay.slugline splay.slugline.setting".
I guess the simple question is: how do you stack more than two (the document and the element) scopes?
In Markdown a link gets text.html.markdown, markup.paragraph.markdown, markup.underline.link.markdown... how do I do that?
Oliver,
you'll want to look into named captures. For instance in the LaTeX bundle, we have the following:
{ name = 'meta.verb.latex'; match = '(\verb[*]?)(\S)(.*?)(\2|$)'; captures = { 1 = { name = 'support.function.verb.latex'; }; 2 = { name = 'keyword.operator.delimiter.latex'; }; 3 = { name = 'markup.raw.verb.latex'; }; 4 = { name = 'keyword.operator.delimiter.latex'; }; }; },
So, what this does is, if you have: \verb|foo|
then the whole thing will be meta.verb.latex while \verb will be support.function.verb.latex, the two |'s will be keyword.operator.delimiter.latex, while foo becomes markup.raw.verb.latex In other words, groups appearing in your match expression are captured, and they can be given names. 0 is the whole expression, 1 is the first group etc.
On Feb 19, 2006, at 3:46 PM, Oliver Taylor wrote:
I guess the simple question is: how do you stack more than two (the document and the element) scopes?
In Markdown a link gets text.html.markdown, markup.paragraph.markdown, markup.underline.link.markdown... how do I do that?
Haris