Those docs you linked to are for ST3. Here are the docs for ST2. Note there is not on_window_command
. That aside, you may want to take a look at Settings#add_on_change
. I've never used that method in the API before, but based on the description, it should do what you want.
Edit
Know you have solution already, but adding this for anyone else that comes by this.
You would likely tie into an event, such as on_load
or on_new
so the command will run on any newly created view.
import sublime_plugin
class TestCommand(sublime_plugin.TextCommand):
def run(self, edit):
settings = self.view.settings()
settings.add_on_change("color_scheme", self.callback)
def callback(self):
print(self.view.settings().get("color_scheme"))