This produces a warning with latest Xcode, stating that it produces a copy, as the variable is already const. This does seem a little strange, so it could be a problem with the analyzer, but not marking these variables const shouldn’t affect anything.
We only set underline and strikethrough when those are enabled, and use applyFontTraits:range: instead of explicitly setting the font.
The latter should avoid breaking font substitution, although to be safe, we still call fixFontAttributeInRange:.
This was required when we linked each framework as its own thing, which we do not do anymore, and if we do go back to this system, we can simply have symbols public by default.
This does change ranking of the wildcard scope selector, as incase of a wildcard match, the old code did not change the rank, so it would be up the caller, which was 1 for bundle item matching but 0 for settings and theme matching.
This doesn’t do any caching of style lookups so performance is worse than theme_t and it also lacks an API to control the initial base font.
For now, the intention is to use this for system dialogs, such as the Find dialog, but long-term it should also be used by OakTextView, at which point, caching and base font support should be added.
If we set ‘plain bold’ then it means that italic and underline are explicitly disabled (should a more general theme rule enable them), but bold is left enabled.
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.
The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.
Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
I mainly dislike the trailing zeroes because CGFloat used to be a float but 1.0 is a double (1.0f would be a float). So better to under-specify and let the compiler figure out the proper type.
This is enabled by adding the following to your theme:
colorSpaceName = sRGB;
The default color space used for themes is “Apple Generic RGB” which is a bad choice for interoperability with other software (e.g. exporting a theme to CSS, creating theme colors in Photoshop, and similar).
Related to issue #768.
Since styles_for_scope effectively ignore the font parameters (and instead return styles based on the font parameters used when the cache entry was created) it is a better design to have theme_t own the font. This way, changing it can do the proper cache invalidation.
A minor downside is that we can now change the font of the theme without also changing the layout’s font, which wouldn’t cause proper layout invalidation — since layout_t owns theme_t though, users of a layout should always change font via layout_t (which will then change it in the theme).
Also, themes cannot be shared between views that wish to use different font settings.
Font name and font size was being used in the cache key as a way to avoid having to do cache invalidation. This comes at a price of a 3X slow down. Instead clear the cache when font size/name changes. Excessive font name/size switching should be deterred IMO, why not with slowdowns? so no real downside. This does not affect themes setting font name/size, as they are handled by another mechanism.
Previously, if no themes were active, the gutter colors would
not be set. This would, effectively, give you random gutter colors
on TextMate startup. (or, sometimes, a completely transparent gutter).
Previously all the colors were calculated so setting e.g. the icon color made it sort of necessary to also set the iconHover and iconPressed color.
Now the default icon hover and pressed colors are a potential user supplied icon color. Likewise, the default icon color is a potential user supplied foreground color, etc.
This removes all the blending, the need to provide a scope selector to obtain them, and no longer taxes the general syntax highlight (by no longer having to carry around a dozen gutter styles per scope).