Home Download Buy Blog Forum Support

Setting fontStyle to 'underline' in theme file doesn't work

Setting fontStyle to 'underline' in theme file doesn't work

Postby MattDMo on Sun Feb 10, 2013 8:41 pm

Hi,
I have a pretty extensive .tmTheme set up for working with Python, with a good system of editing it - I use the visual theme editor in Textmate v.1, then symlink it into my Sublime preferences directory (I'm on OSX 10.8.2, with ST2 build 2217). Everything works great, except I can't get underlining to work. Here's an example:

Code: Select all
      <dict>
         <key>name</key>
         <string>Support.function.magic</string>
         <key>scope</key>
         <string>support.function.magic</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string>bold italic underline</string>
            <key>foreground</key>
            <string>#E3A0FF</string>
         </dict>
      </dict>


In ST2, a magic function like __le__ shows up in light purple, with bold and italic text, like expected, but not underlined like it would show up in TextMate (TM doesn't do bolding properly, but that's a different forum...). It doesn't matter the language or context, I can't get underlining to work. The only thing that does work is bracket matching, which does show a thin underline for matching pairs. Any suggestions?

Thanks,
MattDMo
MattDMo
 
Posts: 36
Joined: Thu Jan 17, 2013 3:15 am
Location: near Boston

Re: Setting fontStyle to 'underline' in theme file doesn't work

Postby MattDMo on Sat Feb 16, 2013 10:36 pm

Anybody? I haven't found anything via Google, the official docs, the unofficial docs, StackOverflow.com, or apple.stackexchange.com. All I'm looking for is to figure out if you have underlining set up as part of your theme, and/or whether that is even implemented in ST2. If not, is it planned for (or already in) ST3? Help!

Thanks,
mdm
MattDMo
 
Posts: 36
Joined: Thu Jan 17, 2013 3:15 am
Location: near Boston

Re: Setting fontStyle to 'underline' in theme file doesn't work

Postby MattDMo on Fri Mar 15, 2013 2:42 am

I have finally come to the conclusion that underline is just not implemented in ST2, and not yet in ST3. I've posted a feature request, so please vote for it! In the meantime, you can try the PersistentRegexHighlight plugin (also available via Package Control) which allows for defining an underlined region by scope (as defined in the .tmLanguage file) as well as by regex. There's the potential for memory problems, especially for very large files, but it's a start.

Jon Skinner, please implement fontStyle=underline! I'll gladly pay you for it! (Again)
MattDMo
 
Posts: 36
Joined: Thu Jan 17, 2013 3:15 am
Location: near Boston

Re: Setting fontStyle to 'underline' in theme file doesn't work

Postby lawlist on Mon Apr 08, 2013 8:03 pm

@MattDMo: Bold / italics / underline is possible by using a combination of PersistentRegexHighlight (to underline), and defining the remainder in the theme file (i.e., bold italic, and/or colors [foreground / background]). To my knowledge, PersistentRegexHighlight presently only supports one or the other (highlighting or underlining) -- hence, the aforementioned workaround to get everything (i.e., colors [foreground/background] + underline + bold + italics).

@MattDMo: Thank you very much for the idea to bold and italicize, and thank you also for the referral to PersistentRegexHighlight.
Attachments
Screen Shot 2013-04-08 at 12.56.58 PM.png
Screen Shot 2013-04-08 at 12.56.58 PM.png (176.11 KiB) Viewed 1979 times
lawlist
 
Posts: 54
Joined: Thu Feb 21, 2013 6:47 pm

Re: Setting fontStyle to 'underline' in theme file doesn't work

Postby robertcollier4 on Mon Apr 08, 2013 9:58 pm

So many things missing in Sublime - the (currently sole) developer should really consider actively recruiting for a 2nd or 3rd developer to make Sublime into an actual complete product.

It is clear that the single developer is not able to keep up with the demand or the pace that the community would like Sublime to be built at.
robertcollier4
 
Posts: 154
Joined: Sun Feb 24, 2013 5:37 pm

Re: Setting fontStyle to 'underline' in theme file doesn't work

Postby facelessuser on Mon Apr 08, 2013 11:38 pm

underline is an artifact from the tmTheme (Text Mate theme) which had supported underline. I am pretty sure Jon doesn't support underline so as not to conflict with the underline regions that can be drawn on top of the code. Maybe I am wrong; the problem is Jon doesn't always comment on why he does or doesn't do something.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm


Return to Technical Support

Who is online

Users browsing this forum: mwb1100 and 18 guests