Home Download Buy Blog Forum Support

onActivated not firing in ST2

onActivated not firing in ST2

Postby erikpukinskis on Wed May 04, 2011 5:06 pm

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?:

Code: Select all
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!
erikpukinskis
 
Posts: 1
Joined: Wed May 04, 2011 5:03 pm
Location: Austin, TX

Re: onActivated not firing in ST2

Postby guillermooo on Wed May 04, 2011 7:29 pm

Your Sublime 1 knowledge seems to be interfering here: it's '.on_activated()', not '.onActivated()'.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests