Sublime Forum

(osx|windows|linux) Color Scheme Editor (BETA)

#35

You’d be surprised. Engineers use languages like Python or Ruby for lots of things. I one time was given the task of identifying what in our Hardware Abstraction Layer (HAL) needed to change for two different new pieces of new hardware we were going to start using. It would have taken me days. I wrote a tool to process all of the registers for the new hardware and compare it to the closest hardware in our HAL. Compile a list of all kinds of changes, and then based on rules, filter out the ones that were probably not a big deal, then scan our code base for references to those different registers further filtering out which ones I needed to look at. Now the task takes me 3 seconds. Now I just get sent a spreadsheet of registers for new hardware, fire up my program, and I get a printout of important register differences and what file and what line in our code we access it. Then I just need to fire up my editor and look at those individual cases, or hand off the output to whomever is doing the task instead of me. That’s just one case.

0 Likes

#36

Yeah, it’s pretty hardy to beat python as a general purpose scripting language. pip install $magic :smile:

0 Likes

#37

0.0.4 is available (go ahead and update the sublime plugin part as well, but it isn’t critical to do so).
-File name in titlebar
-Add menu
-Shortcut help
-Change shortcuts to make more sense
-About box
-Save as functionality
-Wildcard fix for OSX
-Add search
-Small fixes
-Better debug stuff inside
-Anything else I forgot

With that said, there are a couple of things I hope to fix in 0.0.5 (hopefully the last beta) coming up:
-Faster, more optimized update of internal theme structure on live edit changes (maybe only save tmTheme file on updates, and update JSON on close of file).
-Possibly allow disabling of live editing of the file for those who want to; manual save (would be even more snappy then).

That’s really all I have left before an official release, unless some bugs crop up.

0 Likes

#38

u r my hero, point

0 Likes

#39

0.0.5 is up. (Plugin side must be updated as well, or live edits won’t work until you do).

-Live edit now optional
-Manual save mode (more traditional app behavior) is now default (but when run from plugin, default is live edit)
-Save as shortcut moved
-Re-write shortcut code
-More optimized updating of the JSON
-When in live edit mode, only re-generate JSON on app close.
-Generate missing tmTheme or JSON on startup
-Protect against duplicate keys in global settings
-Fix regression: cell highlight didn’t change on color luminance

Okay that is all the current planned features for the first official release. Probably just need to throw together some kind of icon now…oh yeah, and get linux running.

Anyways, report any bugs if you find them. I don’t plan on adding new features or tweaking this until after the official release, so now is the time to find and report the bugs.

0 Likes

#40

I wanted to announce known bugs:

  • Removing all font styles will leave the table in the editor still showing the last font (cosmetic). Will be fixed in next release.

  • When moving an item, and it goes out of view, the scrolling does not follow the item (cosmetic). Will be fixed in next release.

  • When moving an item (particularly in a large theme file), sublime will throw invalid XML errors. This is not an error with theme generation, just that sublime can’t keep up with reloading the files proper with the live editing enabled. Possible fix coming in next release

All of the above issues will be fixed, but the XML error is bit trickier. I can probably add a delay after live updates to give sublime enough time to reload, maybe half a second? I will probably try it out in the next release to get feedback from users.

0 Likes

#41

Hey man, pretty damn nice plugin. It somehow remember me of e-text :smile:

Few issues/improvement ideas (i’m on windows, i have no idea what’s happening on other platforms):

  1. Maybe it’s a good idea to set the background of the scope settings tab to be the same as the theme background, otherwise…
  2. double click on a scope to edit. Press Esc. Nothing happen (it should either go away silently, something like a Cancel)
0 Likes

#42

1.) Are you sure it isn’t? For me, the editor sets the rows of all entries to their defined background color, and if not, it sets the background to the global background. If you aren’t defining a global background, then I think it will default to white, just like Sublime does. Is this not what you are seeing?

2.) Yeah, I like that, it was on my list…the list in my head which I should have written down so I wouldn’t have forgotten this :smiley:.

0 Likes

#43

Ahhh!! Now make sense!

One more idea: add buttons for add/remove scopes. I had to fiddle a little to find out that is ctrl+i. Probably two small buttons at the bottom of the window? :smile:

0 Likes

#44

Press Ctrl+B or CMD+B on MAC to see all keybindings. Also, you can go to Help->Shortcuts to see the same keybinding list.

Yeah, buttons might be more intuitive for people just starting to use it. I will look into it.

0 Likes

#45

@iamntz You should have all of your requests in the next version:

0 Likes

#46

the plugin part is working only in st3, am I right?

0 Likes

#47

The editor is Sublime agnostic, but yes, the plugin half has only been coded for ST3. If anyone wants to create a ST2 branch and get it working on the repo, that would benefit a number of people, but it is enough work right now getting the editor finished and working on all platforms; I have no intention right now to backport the plugin half to ST2. I am using ST3 as my main editor, so all of my work is mainly going to be directed there.

0 Likes

#48

0.0.6 is posted on the OP (you only need to update the binary):

-Ensure when font styles are removed that cells get their style updated
-Settings dialogs are now “dialog” type to ensure parent is disabled.
-Esc key now closes settings dialogs
-Add button panel for move, add, delete rows
-Threaded “Live Save” manager to manage when live saves occur in order to keep from getting XML errors in sublime

Let me know if XML errors are still occurring. As far as I know, that is all of the bugs; I am currently done with adding new features for now I think. I am now going to try and get Linux going.

Please report any bugs you may find. Enjoy.

0 Likes

#49

Oh man, you are awesome, thanks for the update! Unfortunately, Esc doesn’t close the edit popup.

Anyhow, here are few more ideas:

  • click on +], the popup show up and, in background, a new row it’s added. If i cancel the editor, the new row is still there. Actually i think it should go away if you cancel.
  • i’ve noticed that some themes have some much more scopes compared to others (space cadet i think it’s the less equiped to say so; sunburst, on the other hand, has a lot of options). Although i believe that scopes are defined on tmLanguage files, not on theme, ii guess it would be nice to have a list of commonly used scopes. Something like a combination between text field and selectbox.
  • a dropdown for selecting other themes

Btw, i think i asked couple of times in the past (but i’m old and i forget shits) there is a way to extend a theme? I mean i like dark themes, but not all (if any!) has brackethighlights or linter scopes. So it would be nice if there was something to say: use this common styles for all themes.

0 Likes

#50

@iamntz

  1. Esc works on Mac at least, I will confirm on windows, if not I will tweak the code again.

  2. Current +] implementation is to add row and then edit it (it was quickest and easiest this way). But I understand why this might not be desirable, and your suggestion is a good one. Only because it isn’t critical, I won’t be jumping on it right away; I will look into better workflow when I get a chance. I was more concerned about getting it functional fast at this point.

  3. I can understand the desire of having a list of commonly used scopes…who’s going to compile this list :smile:? I am building the editor, if someone wants to do some legwork to compile a list of common scopes, I may add a way to import the list; probably as an external settings file.

  4. What do you mean a dropdown for selecting other themes? What other themes? The editor simply gets pointed at the theme files via a file picker or command line. It isn’t tied to sublime in anyway, so it doesn’t know where to find themes without help. Do you mean the plugin side should scan sublime for theme files? Please elaborate.

Thanks for the suggestions.

0 Likes

#51
4. What do you mean a dropdown for selecting other themes? What other themes? The editor simply gets pointed at the theme files via a file picker or command line. It isn't tied to sublime in anyway, so it doesn't know where to find themes without help. Do you mean the plugin side should scan sublime for theme files? Please elaborate.

this should also be visible somewhere in the editor. Right now, to edit multiple themes i had to:

  1. switch theme
  2. launch „edit current theme”

I guess it would be nicer to have a dropdown in the editor itself (don’t forget to add a confirmation if the current theme is not saved! :smiley: )

0 Likes

#52

Keep in mind, the editor is designed to be a standalone app, and then I tap into it via a plugin.

My current plan is:

  • make sure ESC is working properly in all platforms for closing dialogs.
  • Probably adjust insert workflow, but again not critical on my list.
  • Maybe add an “open theme” option in the menu to open a theme via the file picker
  • Look into getting linux working
  • Maybe add a menu in the sublime plugin to list available themes that can be picked to load in the editor

Conditional:

  • If someone provides a list of common scopes, I will look into adding the ability to select them via a dropdown or something.

Maybe in the future:

  • I may allow for the editor to be fed the path to a config file. In that config file, a user could specify folders to scan for theme files, and those theme files could appear in some kind of menu or dropdown list. This may happen sometime in the future, but not right now. I would have to add the ability for the editor to scan the folders, search sublime-plugin zip files, give logic to unpack from said zip files to a temp location. This isn’t even including live edits that show in Sublime. To do that, I need to communicate back to the plugin to switch the theme for live updates (maybe to a settings file that is being watched, maybe sockets, maybe named pipes; I don’t know). At this point, I view it as a nice to have. I want to avoid making the editor dependent on the sublime environment, but allow it to be an independent tool as it was designed to be.

The other thing to keep in mind is that right now I am ready to take a break from this tool, so more ambitious features are going to get stuffed in the wish list for the possible future.

0 Likes

#53

Tried 0.0.6 this morning in OSX (10.7) and Win7x64. Everything worked really nice when called from within Sublime. When called as a standalone editing functionality did not change but when I tried to close the application it would not close. In both OSX and Win 7 I had to kill it because it would not respond to closing the window or Quitting the application.

0 Likes

#54

@rgidney It should have created a log file. Can you post it?

0 Likes