Hi,
I'm playing with the theme editor and sometimes I'm not sure what the scope for a certain item is. I'd like to know if there's an easy way to get the full scope selector for the text under the cursor.
Also, knowing the scope, I wonder how to get the rules that apply to it.
Lastly, is there an straightforward way to revert a color after changing it? Or at least to leave the editor without saving?
Overall, I'm really liking this theme editor and the scoping thing as a whole is really promissing.
On 04/09/2005, at 20.19, Caio Chassot wrote:
I'm playing with the theme editor and sometimes I'm not sure what the scope for a certain item is. I'd like to know if there's an easy way to get the full scope selector for the text under the cursor.
Ctrl-shift-P. It's actually just a command (in the language definition bundle) which does: echo $TM_SCOPE and shows that as a tool tip.
Also, knowing the scope, I wonder how to get the rules that apply to it.
You can always use the exact scope as the “rule”. Scopes work a bit like CSS selectors.
I describe this in: http://macromates.com/blog/archives/2005/07/06/ introduction-to-scopes/
Since then I have added the ability to and, or, and subtract scope selectors, briefly mentioned in latest blog entry (with example) and full details in b17 release notes.
Lastly, is there an straightforward way to revert a color after changing it? Or at least to leave the editor without saving?
Currently not -- though to reset a theme to defaults, you can delete the changed theme, which is saved to ~/Library/Application Support/ TextMate/Themes.
I do plan to add undo and/or a confirmation requester (before save) though.
On 04/09/2005, at 20.57, Caio Chassot wrote:
Also, knowing the scope, I wonder how to get the rules that apply to it.
You can always use the exact scope as the “rule”. Scopes work a bit like CSS selectors. ...
Oh, i didn't mean that. I meant finding the definition in the theme editor that applies to a certain rule/scope.
Ah, well, that's more complicated, because the styles that apply for a given scope can come from multiple rules.
But I see how this could be useful.
On Sep 04, 2005, at 16:13, Allan Odgaard wrote:
Oh, i didn't mean that. I meant finding the definition in the theme editor that applies to a certain rule/scope.
Ah, well, that's more complicated, because the styles that apply for a given scope can come from multiple rules.
But I see how this could be useful.
Maybe you could highlight, in the theme editor, the rules that apply to the text at the cursor position.