Conversation
|
I've run into a bit of trouble with I have solved the problem with a moderately ugly hack. After spending several hours debugging this, I'm confident that this was the problem and that the solution works — though I wouldn't call it pretty. (There's no such problem with |
|
@FichteFoll Any thoughts on the above hack? |
st3/sublime_lib/settings_listener.py
Outdated
| If `selector` is callable, then the derived value is ``selector(self)``. | ||
| If `selector` is a :class:`str`, | ||
| then the derived value is ``self.get(selector, None)``. | ||
| Otherwise, the derived value is ``projection(self, selector)``. |
There was a problem hiding this comment.
With the "selector" concept being reused now, it might be sensible to add a section to our docs with more details and examples.
|
Regarding the |
|
I wrote up some docs for the projection function. I'm not completely satisfied with it, but it might be good enough. |
972ba17 to
a7d3414
Compare
For #164.
Notes:
OnChangedOptionsis a named tuple so that we can easily support more arguments toon_setting_changed.asyncargument toon_setting_changed. Alternatively/additionally, we could have a separateon_setting_changed_asyncdecorator.SETTINGS_NAME = 'Foo', we could just havesettings = sublime.load_settings('Foo.sublime-settings'). I think the former might be slightly less prone to user error.on_setting_changeddecorator outside aBaseSettingsListener. Haven't looked into implementation yet.ViewSettingsListenerorGlobalSettingsListenerfrom their plugin, Sublime will dutifully use them. This probably doesn't really matter, but we could special-case this if we want.str(id(self))? I suspect not.WindowSettingsListener? I also suspect not.selectoronly supports strings and functions, but we could just use_util.collections.get_selector.