Kronuz / ColorHighlight

🎨 Lightweight Color Highlight colorizer for Sublime Text
MIT License
121 stars 12 forks source link

Not working for some .sublime-color-scheme #9

Closed bitst0rm closed 6 years ago

bitst0rm commented 6 years ago

ColorHighlight is not liable against some type of JSON formatting. It will fail if it uses.sublime-color-scheme file that has been formatted with jsformatter or some sort of custom formatting before, means: "rules": [{ fail... also "rules": [ { fail too...

Solution: in colorizer.py#L217 change from: m = re.search(r'([\t ]*)"rules":\s*\[[\r\n]+', content) to: m = re.search(r'([\t ]*)"rules":\s*\[+', content)

Its much safer for all kind of .sublime-color-scheme formattings.

Kronuz commented 6 years ago

Interesting. Thank you!

That last + shouldn’t be there, does it?

Could you please make a pull request?

bitst0rm commented 6 years ago

the + is useless of course. the request is on your way, thank you!