[TxMt] Re: Using „First Line Match” in grammars

Allan Odgaard mailinglist at textmate.org
Wed Oct 29 14:06:02 UTC 2014


On 25 Oct 2014, at 0:04, Stefan Daschek wrote:

> Makes sense! So the precendence is like this?
>
> 1. Use explicit binding from Global.tmProperties.
> 2. If none found, use first line match.
> 3. If none found, use file types (extension).

Yes.

> If more than one bundle claims a file type by extension, is it 
> “longest match wins“? (The RSpec bundle uses `_spec.rb` which 
> seems to take precedence over Ruby's `rb` even for empty files.)

Yes, longest wins.

> And what happens if two bundles claim the exact same extension? (Both 
> Ruby and Rails claim `rb`, and apparently the Ruby bundle “wins”.)

This is undefined.

>>  [ *.rb~*_spec.rb ]
>>  fileType = source.ruby.rails
>
> Cool – didn't know that it's possible to combine wildcards like 
> this!

This is also useful when doing folder searches, and one can add multiple 
exclusions.


More information about the textmate mailing list