Sublime Forum

[CSS, theme] use real colors to highlight colors props

#61

I will take a stab at it on an experimental branch. I will let you test off that, I can tweak that until we get something working. I should be able to have something going before the new year, but I won’t make any promises.

What I come up with here might not go on the main branch because essentially what I will be providing is a quick and dirty workaround. Eventually the root of the problem will have to be dug up. I will be patching the symptom but not the cause.

0 Likes

#62

Okay thanks, ill wait :smile:
Let me know when its done so i can test it :wink:

Anyway Merry Christmas to you :smile:

0 Likes

#63

I have an attempt to put a bandaid on the issue at github.com/facelessuser/sublime … Workaround

Please test and let me know if it works. I also put some debug code in so I need you to open up the console up and find the message the plugin outputs and post it here. I put an example of mine below. Yours will have the same “Start Debug” and “End Debug” markers. I need to understand how your path is getting messed up. To fix it proper, but this bandaid may make the plugin useful for now. If it doesn’t, I can take another swing at it.

Example output:

[code]####Start Debug####
Sublime Path: /Users/facelessuser/Library/Application Support/Sublime Text 2
Theme Path: /Users/facelessuser/Library/Application Support/Sublime Text 2/Packages/User/Colorized-946901263265910-Monokai Soda.tmTheme

End Debug####[/code]

0 Likes

#64

Well it still does the same thing, still the same error.
Here is the debug code:

####Start Debug####
Sublime Path: D:\Documents and Settings\Risk0\Application Data\Sublime Text 2
Theme Path: D:\Documents and Settings\Risk0\Application Data\Sublime Text 2\Packages\Color Scheme - Default\Colorized-432035491641541-Putty.tmTheme
#### End Debug####

But there is also this error line, as before (when a window pops up)

error: Error loading colour scheme Packages/D:\Documents and Settings\Risk0\Application Data\Sublime Text 2\Packages\Color Scheme - Default\Colorized-432035491641541-Putty.tmTheme: Error parsing plist xml: Failed to open file In file "Packages/D:\Documents and Settings\Risk0\Application Data\Sublime Text 2\Packages\Color Scheme - Default\Colorized-432035491641541-Putty.tmTheme"

Im not an expert but it seems like the path in the debug code is correct, but in this error the path starts with “Packages/” which shouldnt be there :smiley:

0 Likes

#65

Yeah, that is what I am guessing too. I put in some code to strip out “Packages/” at one point in the code, assuming I knew where the issue was, but apparently I do not know where the issue is.

Right now I am guessing where the issue is because all of my computers don’t do what yours is doing. I thought somehow that at this particular point in code your paths were wrong, but as you can see from the debug output, they were correct, which means that somewhere else things are going wrong.

This may take me a while because since I can’t reproduce your issue, I have to make wild guesses. This looks to be a more difficult issue to track down because your paths look fine. I was really hoping your paths were wrong at that point in code, but the only way to make sure was to have you post the debug output. At least now, I know something that isn’t wrong, and while that doesn’t fix your issue, I am a little closer because I can rule out that part of the code.

0 Likes

#66

Okay, ill wait and test it if you find and fix the issue.
Hope there wont be more problems with this :smile:

0 Likes

#67

In general, a plugin that does this would not be difficult…

but here is the catch: the current api does not allow to specify a color for highlight, the color must be assigned to a scope that is already defined in a theme file. (at least as far as I understand)!


Trumpet Wedding Dresses|Column Wedding Dresses|Wedding Dresses with Sleeves|New Style Wedding Dresses

0 Likes

#68

Support for Less variables colorization would be a nice plus!

@orange: #dd8826;

0 Likes

#69

Loading any .css file makes “sublime text.exe” eat 25% CPU and show nothing.
Same for “colorize css” from the command palette (I’d really like “LiveCSS: Colorize”) on an unsafed buffer with Syntax set to “CSS”.

{ "keys": "alt+l", "alt+t"], "command": "toggle_global_live_css" }

gave me:

Traceback (most recent call last): File ".\sublime_plugin.py", line 362, in run_ File ".\livecolors.py", line 89, in run TypeError: uncolorize_file() takes exactly 2 arguments (1 given)

I also find it hard to “get started” with this plugin. The documentation is all nice and stuff (I don’t really know Python to begin with) but how do I actually use it? Should be noted on the readme, imo.
Also, doesn’t this package have any configuration? I could not find information regarding this. I would like to apply this functionality on other source files as well (like .tmLanguage) without having to set the Syntax to CSS and loosing the XML style.*

0 Likes