Hi, the Ruby programming language has a library called ERB which allows you to embed Ruby into strings. Frequently these strings are source code for other languages, Ruby on Rails, for example, heavily uses ERB to embed Ruby code into an html file. Because it is so frequently used, it has it's own bundle called HTML(Rails)
I am wanting to use ERB with other projects, and am finding that I can only use one bundle at a time. So I am frequently switching back and forth with shift+control+option+letter which is working fairly well, and not that much extra work, but it does mean that my project always has incorrect highlighting on some portion of it.
Is there a way to create a bundle that understands it's purpose is to work with other bundles? Perhaps at some point, based on it's scope, it could realize that it needs to yield to the second language or something.
Thanks -Josh
Not sure if this is what you're looking for, and I'm not a Rubyist so I'm not too familiar with those bundles, but you can basically scope anything to your hearts desire.
If a command makes sense to actually be active for more than one file type, you just need to extend the scope of the command. Just separate them with commas in the "Scope Selector" field of the Command. Or, if it makes sense to do so, you can choose a more generic scope that umbrellas the desired specific scopes.
Also, a lanugage can extend another language by setting the scopeName of the lanuage to something extends the other lanuage. For example, a lot of XML bundles that focus on a particular type of XML, and not just XML in general, set the language scope to text.xml.specifictype.
I would imagine you'd have to go through all commands and snippets and manually change the scope selectors, which would be tedious to say the least. If you're feeling adventurous, you can open up the bundle package, bring the files therein into TextMate, and do a big search and replace on
<key>scope</key> <string>originalscope</string>
to
<key>scope</key> <string>new scope</string>
I'd make a backup of the bundle first, though!
Hope that helps.
Dru
________________________________ From: textmate-bounces+dru=summitprojects.com@lists.macromates.com [mailto:textmate-bounces+dru=summitprojects.com@lists.macromates.com] On Behalf Of Josh Cheek Sent: Thursday, October 15, 2009 11:19 AM To: textmate@lists.macromates.com Subject: [TxMt] Combining bundles
Hi, the Ruby programming language has a library called ERB which allows you to embed Ruby into strings. Frequently these strings are source code for other languages, Ruby on Rails, for example, heavily uses ERB to embed Ruby code into an html file. Because it is so frequently used, it has it's own bundle called HTML(Rails)
I am wanting to use ERB with other projects, and am finding that I can only use one bundle at a time. So I am frequently switching back and forth with shift+control+option+letter which is working fairly well, and not that much extra work, but it does mean that my project always has incorrect highlighting on some portion of it.
Is there a way to create a bundle that understands it's purpose is to work with other bundles? Perhaps at some point, based on it's scope, it could realize that it needs to yield to the second language or something.
Thanks -Josh