Closed hyperknot closed 9 years ago
Please make sure you've upgraded to the latest version of Python Improved. The alternate highlighting you are seeing is left over from when I included Django constants as their own scope. However, it was annoying to keep both current and backwards-compatible, and I don't think many people were using it, so I removed it. Go to Preferences -> Package Control
, type in _pcu
_ (for Package Control: Upgrade), scroll down the list to Python Improved, and hit Enter. Depending on your platform, version, phase of the moon, etc. you may need to restart Sublime and/or close and reopen the file you're working on to see the differences. It looks like you're using my Neon Color Scheme, so after you upgrade all constants (words that are in ALL_CAPS, optionally containing numbers after the first character) should be in the yellowish-brown color like you see now for CSRF_COOKIE_HTTPONLY
.
Please let me know how it works.
(BTW, you might be using an old version of Neon as well - you could try upgrading that, too.)
I've checked, and i'm on the latest version of everything: 1.4.2 from PI and 1.2.1 from Neon.
However, upon checking I think I've found why is it happening. I've installed 'Djaneiro' package for syntax highlighting Django themes, but it has provided it's own Python syntax as well and it seems to "steal" the .py extension from PythonImproved.
So actually Sublime wasn't using PI for that file, but that crazy Djaneiro syntax.
Yeah, it does that. That was one of the original reasons why I added the Django stuff to PI in the first place, so I wouldn't have to deal with Djaniero craziness :grinning: Glad you figured it out!
Some random variables are detected as constants, while others are not. By adding or removing one character from the beginning, they change colour: