Pragmatism in the real world

Sublime Text 2 Plugin: Function Name Display

As I’m using Sublime Text 2 more and more, I thought it would be useful to display the current method name in the status bar. I poked around on the forums and created a plugin from ideas I found in a couple of different threads.

This plugin is imaginatively titled Sublime Function Name Display!

As I’ve hooked into the on_selection_modified event handler, I was keen to avoid slowing down the editor too much when you move your carat quickly. As a result, I have used a simple waiting system from forum member ‘facelessuser’, to ensure that the plugin only updates the status bar 100ms after you’ve stopped moving the carat.

As I don’t know Python, I copied the code from other people but I’m happy with the way my first plugin has turned out.