In playing around with the theme editor, I ran across some anomalous behavior that caused me to revisit the cursor theme highlighting feature mentioned in my previous post. It turns out that a theme is kind of like a CSS style sheet. That is, more than one theme ‘rule’ may apply to a particular text item in the editor. If the ‘primary’ rule doesn’t define a theme value (such as ‘background color’), then it checks the next rule, then the next rule, etc. So I’ve modified the editor to highlight all matching rules, with a new column ‘S’ (for ‘Score’) that shows the rule priority (1 is the first rule to apply, 2 is the next rule to apply, …). The attached screen shot shows this change:
I’ve also added a ‘clone theme’ button (also shown in the screen shot), that creates a copy of the current theme and selects the copy for editing. This is handy for creating variants or experiments on a theme you already like but want to tinker with.
BTW, the widget next to the clone button is a drop-down selector showing all of your available themes, so you can easily switch between themes using this selector. One nice feature is that once it has the mouse focus, you can use the mouse scroll wheel to quickly cycle through your themes (which also updates your ST2 editor), allowing you to quickly audition various themes on whatever ST2 files you are editing…