This seems like it should be obvious, but I can't work it out.
What do I set the Scope Selector to on a command I want to be available everywhere? My first intuition is just to leave the Scope Selector field blank, but it's not working.
I have several commands in the text bundle using apple-shift-option-P, and one in the HTML bundle. While editing a HTML document when I hit this key combo I only get the HTML command, not the others in the text bundle.
Hmmmm?
Q
On Apr 7, 2006, at 6:25 PM, Quinn Comendant wrote:
This seems like it should be obvious, but I can't work it out.
What do I set the Scope Selector to on a command I want to be available everywhere? My first intuition is just to leave the Scope Selector field blank, but it's not working.
I have several commands in the text bundle using apple-shift-option-P, and one in the HTML bundle. While editing a HTML document when I hit this key combo I only get the HTML command, not the others in the text bundle.
TextMate chooses what command to use based on specificity of scope selectors. Most specific selectors take precedence. If two commands with the same shortcut have the same scope selectors, then it shows both up. Otherwise, it executes the one with highest precedence. This way you can write a generic command for something, and then override its behavior on particular scopes.
So in your case, the generic commands will still work as long as there is no command with the same shortcut and a more specific selector. Try the following: Set the generic commands to have scope "text.html," without the quotes (note the comma). This should make them work outside of text.html (since they are caught by the empty selector following the comma), and also show up when in text.html, because of the text.html bit there.
Q
Haris
On Fri, 7 Apr 2006 19:52:16 -0500, Charilaos Skiadas wrote:
So in your case, the generic commands will still work as long as there is no command with the same shortcut and a more specific selector. Try the following: Set the generic commands to have scope "text.html," without the quotes (note the comma). This should make them work outside of text.html (since they are caught by the empty selector following the comma), and also show up when in text.html, because of the text.html bit there.
Yes, makes perfect sense to me. If I add "text, source, " it will work in all those scopes with the command key.
Allen: considering this is the case, it seems useful to have a magic scope called, say, "global", which can be used when a bundle item should always be called regardless of scope.
Q