Sublime Forum

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

#1

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:

		<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

0 Likes

#2

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

0 Likes

#3

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)

0 Likes

#4

@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.


0 Likes

#5

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.

0 Likes

#6

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.

0 Likes