Sublime Forum

(ST3) Reveal sidebar on hover

#1

Hi!

I’ve written my first Sublime Text plugin!
It lets you reveal the sidebar when you hover the mouse over the left side of the window and hide it when you hover out of the sidebar.

Check it out: https://github.com/mskv/sublime-sidebar-on-hover/

Unfortunately I currently only support Mac OS.

I think it’s pretty interesting in terms of interfacing with Cocoa libraries. ST3 shipps with its own Python interpreter, so I’ve had tonnes of issues when I was trying to include PyObjC libraries in my plugin. Some people have managed to include external libs in their plugins, but I just couldn’t make it work and ultimately I decided to extract the mouse tracking to ObjC code, compile it and run the binary in a parallel process. It’s not a pretty solution and it’s not very pretty code (my first time using Python and ObjC), but it works! Check it out if you ever wanted to use a system library in your plugin.

I will soon update the plugin, because a lot of logic in the python script is responsible for tracking whether the sidebar is open or closed in a particular window. But with the newest ST3 update we now have Window.is_sidebar_visible() and it will make a lot of logic redundant.

2 Likes