[TxMt] Re: Bug in Perl bundle

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sun Oct 19 19:44:13 UTC 2014


On 19 Oct 2014, at 21:24, Allan Odgaard <mailinglist at textmate.org> wrote:

> On 19 Oct 2014, at 15:24, Hans-Jörg Bibiko wrote:
> 
>> I've just encountered that the TAB snippet "pl" executed at the very beginning of EACH document REGARDLESS of the set grammar inserts "#!/usr/bin/env perl".
>> 
>> Either the scope setting is wrong
> 
> This is meant as a feature and also works for rb⇥, py⇥, sh⇥, and maybe more.
> 
> Ideally TextMate would also switch file type when first line is changed to something that matches the “first line match” of a grammar. That way, if you want to create a new perl script, just ⌘N and enter pl⇥ and you have both the proper shebang and the file type automatically set (giving syntax highlight and an appropriate file name extension when saving).

Ok, I see the point of this nice feature, but I wonder why this Perl pl⇥ snippet will be executed and not "my" pl⇥ (since I set the grammar to "my" grammar in beforehand). I thought if you create a tmCommand (or similar), set to a specific grammar source.foo that all keybindings etc. have the priority over "the more general" ones.



> 
>> <key>scope</key>
>> <string>L:dyn.caret.begin.document</string>
>> 
>> [What does "L:" mean?]
> 
> L means “left”.

Ah, thanks for the clarification. Good to know :)


Best, Hans




More information about the textmate mailing list