Home Download Buy Blog Forum Support

Enabling a plugin when distraction mode is on

Enabling a plugin when distraction mode is on

Postby quodlibet on Sun Feb 12, 2012 10:15 am

Hi,

I am trying to limit a plugin, which uses the EventListener, to only function when distraction mode is on.

Any ideas?
quodlibet
 
Posts: 508
Joined: Sat Jun 18, 2011 5:53 pm

Re: Enabling a plugin when distraction mode is on

Postby sublimator on Sun Feb 12, 2012 11:21 am

Create, or edit the existing, `Packages/User/Distraction Free.sublime-settings` and add in the following:

{
"is_distraction_free" : true
}

From there it's just a matter of checking `view.settings().get('is_distraction_free')`

That's one way but there might be others.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Enabling a plugin when distraction mode is on

Postby quodlibet on Sun Feb 12, 2012 2:56 pm

Nifty. Thank you very much!
quodlibet
 
Posts: 508
Joined: Sat Jun 18, 2011 5:53 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests