I was playing around with the new 'theme' setting in ./.tm_properties.
Given the file: ./webapp/WEB-INF/web.xml
this works: [ "text.xml" ] theme = 71D40D9D-AE48-11D9-920A-000D93589AF6
this does not: [ "*.xml" ] theme = 71D40D9D-AE48-11D9-920A-000D93589AF6
this works: [ "webapp/**" ] theme = 71D40D9D-AE48-11D9-920A-000D93589AF6
this does not: [ "webapp/WEB-INF/**"] theme = 71D40D9D-AE48-11D9-920A-000D93589AF6
It was my understanding that all of these selectors should apply the setting to this file? What am missing?
On 6 Jul 2016, at 17:08, Curt Sellmer wrote:
I was playing around with the new 'theme' setting in ./.tm_properties. […] It was my understanding that all of these selectors should apply the setting to this file? What am missing?
It might be the precedence.
Try use Bundles → Select Bundle Item… (⌃⌘T) and switch to Settings (⌘}) then enter “theme” and see if it doesn’t find all your settings, but just sorts them in a way you do not expect.
The gotcha here is that a scoped setting (like `text.xml`) takes precedence over a file pattern match (like `*.xml`), even when the latter is “more local” (in the file system).
This is something I am considering changing.
On 6 Jul 2016, at 17:25, Allan Odgaard wrote:
The gotcha here is that a scoped setting (like `text.xml`) takes precedence over a file pattern match (like `*.xml`), even when the latter is “more local” (in the file system).
Just a correction, the precedence is file patterns (globs) → scopes → untargeted settings.
The file patterns are ranked based on locality where the scope selectors are ranked based on how much of the scope they match, e.g. a global `text.plain` wins over a local `text`, and finally the untargeted settings are ranked based on locality (like the file patterns).
It should probably just be intermixed, so a local untargeted setting wins over less local but targeted settings.
On Wed, Jul 6, 2016 at 10:25 AM, Allan Odgaard mailinglist@textmate.org wrote:
Try use Bundles → Select Bundle Item… (⌃⌘T) and switch to Settings (⌘}) then enter “theme” and see if it doesn’t find all your settings, but just sorts them in a way you do not expect.
with the selector [ "*.xml" ] (which does not work) I get the "theme" items in the following order:
theme = 71D40D9D-AE48-11D9-920A-000D93589AF6 ~/.../.tm_properties > *.xml
theme = other UUID ~/Library/Application Support/TextMate/Global.tmProperties
theme = other UUID TextMate.app > Default.tmProperties
Seems like the order is correct, but I do not get the correct theme.
On 6 Jul 2016, at 11:08, Curt Sellmer wrote:
I was playing around with the new 'theme' setting in ./.tm_properties.
Given the file: ./webapp/WEB-INF/web.xml
this works: [ "text.xml" ] theme = 71D40D9D-AE48-11D9-920A-000D93589AF6
this does not: [ "*.xml" ] theme = 71D40D9D-AE48-11D9-920A-000D93589AF6
I wasn’t able to get it to work based on extension either, but I was happy to see scope selectors work as I’d rather do that way anyway. (Who wants to list every Markdown extension?)
For the sake of documenting things for others, I also found that whitespace matters.
For example, this will match both plain text and Markdown:
[ text.html.markdown,text.plain ]
This won’t:
[ text.html.markdown, text.plain ]
On 6 Jul 2016, at 19:31, Rob McBroom wrote:
I wasn’t able to get it to work based on extension either
This is related to Koen Punt’s issue. Settings targeted at file types (globs) don’t work at all in the current release. I hope to push a fix later today.
For example, this will match both plain text and Markdown:
[ text.html.markdown,text.plain ]
This won’t:
[ text.html.markdown, text.plain ]
This is what the parser expects: `'[' «string» (';' «string»)* ']'`
Here a string can either be quoted or not contain any whitespace.
Though it seems there is no technical reason for this rather strict requirement, so I’ll add a TODO.
![](images/composer-emoji/apple/1f44d.png)
Sent from [Nylas N1](https://nylas.com/n1?ref=n1), the extensible, open source mail client.
On Jul 6 2016, at 7:44 pm, Allan Odgaard <mailinglist@textmate.org> wrote:
On 6 Jul 2016, at 19:31, Rob McBroom wrote:
I wasn’t able to get it to work based on extension either
This is related to Koen Punt’s issue. Settings targeted at file types
(globs) don’t work at all in the current release. I hope to push a fix later today.
For example, this will match both plain text and Markdown:
[ text.html.markdown,text.plain ]
This won’t:
[ text.html.markdown, text.plain ]
This is what the parser expects: '[' «string» (';' «string»)* ']'
Here a string can either be quoted or not contain any whitespace.
Though it seems there is no technical reason for this rather strict
requirement, so I’ll add a TODO.
On Wed, Jul 6, 2016 at 12:45 PM, Allan Odgaard mailinglist@textmate.org wrote:
This is related to Koen Punt’s issue. Settings targeted at file types (globs) don’t work at all in the current release. I hope to push a fix later today.
Thanks Allan. Everything works as expected now.