Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for the new color scheme format #27

Open
eugenesvk opened this issue Sep 22, 2018 · 5 comments
Open

Update for the new color scheme format #27

eugenesvk opened this issue Sep 22, 2018 · 5 comments

Comments

@eugenesvk
Copy link
Contributor

Sublime has recently introduced a new color scheme format (JSON), which makes your great plugin choke since it's internally trying work with the old tmTheme XML format.
Would you please update it to also work with the new format?
Thanks!

@skuroda
Copy link
Owner

skuroda commented Oct 3, 2018

Apologies for the delay. Thanks for the report! I've been out of the loop on what's been happening on ST development, but will try to take a look.

@eugenesvk
Copy link
Contributor Author

No worries, thanks to "prompt_new_color_scheme" : false I was able to work aroud this issue by manually transferring the required scopes to the new color scheme format

By the way, when you look into the new format, which is read in a cascaded way (e.g. a user can override some installed theme for a few selected items by placing only those items inside a theme under the same name in the User folder), it might be possible to avoid creating a new modified theme altogether, but just place the user PersistentRegexHighlight definitions in a similar way so that ST3 would just "cascade" them together to achieve the same effect

@IntoCpp
Copy link

IntoCpp commented Dec 12, 2019

I tried to dig into this problem a while ago but failed miserably. I reverted to an older ST3 version instead. Now at a new job and miss my favorite plug-in.

@skuroda Do you have a time estimate (how many hours) to implement this new support?

@eugenesvk : Could you write a "step by step how to" for your solution using prompt_new_color_scheme? I tried it, and things got all messed-up, I had to re-install Sublime.

@eugenesvk
Copy link
Contributor Author

@IntoCpp
I've just added the following code to my MyTheme.sublime-color-scheme (this declares the colors the plugin needs to use for highlighting)

    { "name"      	: "||<-- Package: Persistent Regex Highlight -->||"},
    { "name"      	: "Highlight Color FF5370",
      "scope"     	: "highlight.color.FF5370",
      "foreground"	: "var(redBright)" },
    { "name"      	: "Highlight Color 00FF00",
      "scope"     	: "highlight.color.00FF00",
      "foreground"	: "var(greenbright)" },
    { "name"      	: "Highlight Color B52A1D",
      "scope"     	: "highlight.color.B52A1D",
      "foreground"	: "var(red6)" },

the variable redBright is defined in the same color scheme file as:

  "variables" : {
     "redBright"  	: "hsl(350, 100%,  66%)"
  },

and this allows me to use these colors in PersistentRegexHighlight.sublime-settings, e.g. for the first color FF5370

	{ //highlight non-breaking space
		"pattern"        	: "\\xA0+|\u00A0+|\u202F+",
		"color"          	: "FF5370",	//the scope for this color is highlight.color.FF5370
		"underline"      	: true,
		"underline_style"	: "squiggly" },

NB! Don't forget to disable the new color scheme generation prompt as mentioned above for the plugin not to break

"prompt_new_color_scheme"	: false, // Prevent being prompted for generation of new color schemes. NB! if disabled, need to manulally add 'highlight.color.HEXcolor' scope to youre color scheme

However, if you're referring to the rest of my comment re. the great cascading nature of the new color scheme format, I've not used it myself as I switched to a manually customized scheme due to issues such as this when different plugins struggle to create new modified schemes and haven't moved to the new better ways

@skuroda
Copy link
Owner

skuroda commented Dec 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants