Incorrect scope selector precedence for fontStyle

Alex Lopatin 6 years ago • updated 6 years ago 1
To replicate:
Use the Mac Classic color scheme on a new file with Python syntax highlighting.
Enter any integer (e.g. 123).
Observe that the scope is "source.python constant.numeric.integer.decimal.python".
Observe the color (#0000CD) and font style (bold).

Expected behavior:
In TextMate the scopes and color are the same, but the font style is regular (ie. not bold).

The relevant section from Mac Classic.tmTheme:

According to the TextMate scope selector docs, the first entry should have a higher precedence because it matches the deeper element ("constant.numeric" vs "constant"), but I doubt there's a problem with the ranking. It's more likely that the value "<string></string>" is being discarded when in fact it signifies that the scoped text is not meant to be bolded, italicized, or underlined.

It would be great if Sublime recognized the empty value for what it is; alternatively, you could add a "regular" font style (and perhaps have Sublime automatically replace the legacy syntax on load to reduce ambiguity).

Thanks! (Build 2169, OSX 10.7)

Edit: Apparently UserEcho strips whitespace from code/pre tags; replaced with gist link.
This appears to be fixed as of recent builds. =)