Sublime Forum

Pulse: An eye candy plugin

#1

Hey,
A few months ago I started working on a small and totally useless plugin called Pulse, to get to know the Sublime plugin API better. It basically only does this:

https://camo.githubusercontent.com/31a1d579682c3b56e51801040e61731d236b30b4/687474703a2f2f6769616e742e6766796361742e636f6d2f44656570446566656e73697665486f6368737465747465727366726f672e676966

It’s just eye-candy, really.

A “problem” so to say was Sublime Text’s support of relative paths to *.sublime-package files. You can see in my code, especially PulseCommand’s run-method that I had to do quite a bit of path-magic to solve some problems, for example extracting a resource from an installed package file, is there a better or easier way to do this? Any feedback regarding the code would be appreciated, and please keep in mind: It was just for fun, I am aware that the plugin host process consumes huge amounts of CPU needlessly when it runs and that the usefulness of the plugin is non-existent.

1 Like

#2

I very quickly skimmed over some of the source code. Something that jumped out at me is how you only check the installed packages for the package. I could be using one of the default color schemes, which would be in a different location. Obviously not an issue for many plugins as they don’t have to worry about extracting other resources. Anyways, you can see how I deal with it for PackageResourceViewer (link). Could I extract in a better way, perhaps, but it works for me :smile:

0 Likes

#3

Thank you for your answer, that’s exactly what I was looking for. I was unaware for example of the “installed_packages_path” function etc. I think I might just rewrite the plugin at some point :smile:!

0 Likes

#4

Ok, so I pretty much rewrote the plugin now, making way better use of Sublime Text 3’s API abilities. There’s no manual threading anymore and I don’t have to extract the package’s resources at all.

1 Like