[TxMt] Re: Problem with "Selected Text or Scope"

Hans-Jörg Bibiko bibiko at eva.mpg.de
Mon Dec 7 11:31:42 UTC 2009


On Dec 7, 2009, at 12:11 PM, Michael Sheets wrote:

> On Dec 7, 2009, at 2:11 AM, Hans-Jörg Bibiko wrote:
> 
>> I fiddled around with this topic, and it's in some sense mystically.
>> 
>> I have two Macs a MacBook and a Mac Pro running the same TM, OS version T 1.5.9 (1589) and Mac OSX 10.6.2; and I have a bundle command:
> 
> What is the scope selector of this command? You mention using it outside of a comment which wouldn't be possible with a proper scope.

Oh my goodness, I didn't see the forest for trees. Of course, the scope selector!!

If I add to my command the Scope Selectors which should match like: "comment, variable"

it works of course.

Sometimes I feel like a raw recruit ;) esp. if one missed to read TextMate's manual chapter 10.1 Command Input carefully:
...
One fallback unit which requires a little explanation is Scope. When the input is set to this, TextMate will search backwards and forwards for the first character ***which is not matched by the scope selector of the command*** and use those as boundaries for the input.

This means that if the language grammar marks up URLs and gives these a scope of markup.underline.url then a ***command with that as the scope selector*** can set its input to Selection or Scope and will thus get the URL as input, when this command is executed with the caret on an URL.

Sorry for the confusion :)

Best,
--Hans

PS The mystic thing I spoke about also is solved. I copied my test command to the other machine without executing "Reload Bundles" :/ and my "old" command had the scope selector "comment".




More information about the textmate mailing list