Home Download Buy Blog Forum Support

Syntax Highlight

Syntax Highlight

Postby badboy on Wed Jan 18, 2012 4:43 pm

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.
Posts: 10
Joined: Fri Jan 13, 2012 11:51 am

Re: Syntax Highlight

Postby jbrooksuk on Wed Jan 18, 2012 4:50 pm

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.
Posts: 926
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Syntax Highlight

Postby facelessuser on Wed Jan 18, 2012 4:52 pm

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.
Posts: 1780
Joined: Tue Apr 05, 2011 7:38 pm

Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests