Home Download Buy Blog Forum Support

settings.add_on_change() for project settings

settings.add_on_change() for project settings

Postby spyder on Tue Sep 03, 2013 10:56 pm

I'd like to know when the project settings change so I can update the configuration in my plugin. Right now, I'm using sublime.load_settings("Preferences.sublime-settings").add_on_change() which picks up saving user preferences but not project preferences.

I haven't tried it yet, but I have a theory that view.settings().add_on_change() might work - however it could get messy trying to ensure I only have one listener when views can be closed at any time.

This could probably be addressed with an API to access the project settings.
spyder
 
Posts: 6
Joined: Wed Jan 18, 2012 10:45 pm

Re: settings.add_on_change() for project settings

Postby spyder on Tue Sep 03, 2013 11:16 pm

ok I've now tried view.settings().add_on_change, doesn't work :)
spyder
 
Posts: 6
Joined: Wed Jan 18, 2012 10:45 pm

Re: settings.add_on_change() for project settings

Postby skuroda on Tue Sep 03, 2013 11:25 pm

Not that this addresses your issue about a listener for project settings, but you can access the project data in ST3 (doesn't seem like this will be ported to ST2). See "window#project_data"
skuroda
 
Posts: 690
Joined: Fri Oct 05, 2012 8:11 am


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 5 guests