Home Download Buy Blog Forum Support

Selective Non-Italics

Selective Non-Italics

Postby ajpalkovic on Wed Jan 18, 2012 6:30 pm

I have all comments set to fontStyle italics in my tmTheme.

I've added rules to the js grammar to highlight annotations. Currently, these are italicized because they are in a comment. I would prefer if they were not. Is this possible yet?

These are the two tmTheme rules. I have tried multiple variants for fontStyle including regular, Regular, and an empty string, I restarted sublime and removed the cache files each time too. What am I doing wrong?

The relevant scope is something like: source.js comment keyword.documentation.annotation
Code: Select all
      <dict>
        <key>name</key>
        <string>Comment</string>
        <key>scope</key>
        <string>comment</string>
        <key>settings</key>
        <dict>
          <key>fontStyle</key>
          <string>italic</string>
          <key>foreground</key>
          <string>#8A8A8A</string>
        </dict>
      </dict>
      <dict>
        <key>name</key>
        <string>annotation</string>
        <key>scope</key>
        <string>keyword.documentation.annotation</string>
        <key>settings</key>
        <dict>
          <key>foreground</key>
          <string>#FB9933</string>
          <key>fontStyle</key>
          <string>regular</string>
        </dict>
      </dict>
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Selective Non-Italics

Postby jps on Wed Jan 18, 2012 9:46 pm

Currently, italic / bold is only ever added by rules, and not removed.

You can work around this by splitting the comment scope into two parts: one which sets the color, and another that sets the font style. Change the scope in the one that sets the font style to 'comment - keyword.documentation.annotation'
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: Selective Non-Italics

Postby ajpalkovic on Wed Jan 18, 2012 11:52 pm

oooo, I forgot I could use minus in tmThemes. Thanks much.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 25 guests