Sublime Forum

Settings.add_on_change() for project settings

#1

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.

0 Likes

#2

ok I’ve now tried view.settings().add_on_change, doesn’t work :smile:

0 Likes

#3

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”

0 Likes