Sublime Forum

Python color scheme error on key words?

#1

Hi everybody,

I am confused regarding the coloring of my python code, I tried with 2 different themes with their respective color schemes but it is still the same.

“def” and “return” are both key words, so they should be both yellow.
“minutes” is a variable which is orange.

Why is “return” orange then? Maybe I am misunderstanding something?

My current view:

What I am expecting:

0 Likes

#2

Try the default Monokai scheme. That should have a distinct color for function calls and keywords. I don’t think the Syntax tokenization is wrong here, though I can’t specifically verify right now.

2 Likes

#3

It does work with the default color scheme Monokai.

I was using flatland and predawn before until I noticed. But I doubt such well known color schemes can have this mistake…

0 Likes

#4

The syntax of the language determines what each character represents and the color scheme uses that information to know what colors and font styles to use.

That means that if it works with some color schemes and not with others, then the fault lies within the color schemes that are not coloring things like you want because the syntax remains the same.

According to PC (assuming that’s where the color schemes you’re talking about come from) those packages were last updated between 2 and 4 years ago, but the syntaxes that ship with Sublime are constantly being improved by the community.

As such it’s entirely likely that not only could your problem be that the author of the color scheme wanted those things to be colored similarly but also that they haven’t kept up to date with new advances in the syntax that allow for more subtle changes.

2 Likes

#5

I understand.

Seems the only solution is to use another theme then or modify it myself, but I have no intention or much less, the idea of how to do so.

Maybe there is a way to notify the author of this and see if they can update them for the future?

0 Likes

#6

If you look at the page for the appropriate package on packagecontrol.io you can click on the Issues link to go to the related issue tracker and open an issue with the author of the package to see if they’ll update their schemes.

0 Likes

#7

Thank you.

0 Likes