Sublime Forum

Syntax Highlight

#1

Why does syntax highlighting of markdown and restructured text depend on color scheme? With Sublime Text 2 (Beta 2165) only Twilight color scheme seem to work for both markdown and restructured text.

0 Likes

#2

Because Twilight covers more selectors than the other themes you have tried?

I personally had to add some git selectors for differencing to the theme I use.

0 Likes

#3

tmTheme files define code scopes and their associated colors, italics, bolds, etc.

tmLanguage files define regex that locates certain snippets of texts and gives them one of the defined scopes. This allows for a consistency of color scheme across any language.

Some languages though might define these specific scopes for markdown etc to be the same color, or might now cover all the same scopes, so it will then look like there is no syntax highlighting, but what you are actually seeing is the theme does not paint those scopes differently. If the tmLanguage file was responsible for the colors, you would have to have a new tmLanguage file that for every language for every theme.

In short, it would be a mess. The way it is now is the better approach.

0 Likes