I’m coming across a bug. When Sublime starts up, the Corona Editor plugin tries to read values from its settings files, and provides default values. However regardless of the default values, during startup, the settings instance returns None for all keys tested. If I reload the plugin after Sublime is up and running the values are set correctly. Is this a bug with Sublime or is Corona Editor doing something odd?
The offending code looks like:
def __init__(self):
_corona_utils.debug("CoronaLabs: __init__")
global CoronaCompletions
CoronaCompletions = self
# Use fuzzy completions (essentially search for the characters in the target even if separated)
self._use_fuzzy_completion = _corona_utils.GetSetting("corona_sdk_use_fuzzy_completion", default=True) # returns None during startup
# Remove whitespace in completions to match some coding styles
self._strip_white_space = _corona_utils.GetSetting("corona_sdk_completions_strip_white_space", default=False) # returns None during startup
The get setting function is a simple wrapper:
def GetSetting(key,default=None):
# repeated calls to load_settings return same object without further disk reads
s = sublime.load_settings('Corona Editor.sublime-settings')
return s.get(key, default)
Given the different behaviour depending on where Sublime is in its state implies to me somethings wrong with Sublime, but as the editor code isn’t mine I’m happy to blame it too