Sublime Forum

onActivated not firing in ST2

#1

Hi folks…

I’m trying to get started with a very simple plugin in Sublime Text 2… I figured out some of the basics (sublime_plugin instead of sublimeplugin, EventListener instead of Plugin) but I can’t get my code to fire when I switch views… any ideas why this wouldn’t work?:

import sublime, sublime_plugin

class Recency(sublime_plugin.EventListener):  
	def onActivated(self,view):
		print view.fileName(), "is now the active view"

It’s failing silently. Thanks for the help!

0 Likes

#2

Your Sublime 1 knowledge seems to be interfering here: it’s ‘.on_activated()’, not ‘.onActivated()’.

0 Likes