lib/subl/settings.py
def bind_on_change_settings(callback,
                            filename=SUBLIME_SETTINGS_FILENAME):
    '''
    Binds `callback` to the on-change-settings event. The settings are loaded
    from `filename`, which should be the base name of the file (i.e. not the
    path to it). When loading, the settings are parsed into a `Settings`
    instance, and this instance is supplied as an argument to the callback.
    When called, this will automatically load the settings for the first time,
    and immediately invoke `callback` with the initial settings.
    '''
    logger.debug('loading settings from: %s', filename)
    settings = sublime.load_settings(filename)

    def on_change_settings():
        logger.debug('settings have changed, reloading them')
        settings = sublime.load_settings(filename)
        extracted_settings = Settings(settings=settings)
        callback(extracted_settings)

    logger.debug(
        'binding on-change handler using key: %r', SUBLIME_SETTINGS_WATCH_KEY,
    )
    settings.clear_on_change(SUBLIME_SETTINGS_WATCH_KEY)
    settings.add_on_change(SUBLIME_SETTINGS_WATCH_KEY, on_change_settings)

    logger.debug('loading initial settings')
    initial_settings = Settings(settings=settings)

    logger.debug(
        'triggering callback with initial settings: %s', initial_settings
    )
    callback(initial_settings)

    return initial_settings

    Binds `callback` to the on-change-settings event. The settings are loaded
    from `filename`, which should be the base name of the file (i.e. not the
    path to it). When loading, the settings are parsed into a `Settings`
    instance, and this instance is supplied as an argument to the callback.
    When called, this will automatically load the settings for the first time,
    and immediately invoke `callback` with the initial settings.
    
Binds `callback` to the on-change-settings event. The settings are loaded
from `filename`, which should be the base name of the file . When loading, the settings are parsed into a `Settings`
instance, and this instance is supplied as an argument to the callback.
When called, this will automatically load the settings for the first time,
and immediately invoke `callback` with the initial settings.
Binds ` callback ` to the on - change - settings event . The settings are loaded from ` filename ` which should be the base name of the file . When loading the settings are parsed into a ` Settings ` instance and this instance is supplied as an argument to the callback . When called this will automatically load the settings for the first time and immediately invoke ` callback ` with the initial settings .
def bind_on_change_settings(callback,
                            filename=SUBLIME_SETTINGS_FILENAME):
    logger.debug('loading settings from: %s', filename)
    settings = sublime.load_settings(filename)
    def on_change_settings():
        logger.debug('settings have changed, reloading them')
        settings = sublime.load_settings(filename)
        extracted_settings = Settings(settings=settings)
        callback(extracted_settings)
    logger.debug(
        'binding on-change handler using key: %r', SUBLIME_SETTINGS_WATCH_KEY,
    )
    settings.clear_on_change(SUBLIME_SETTINGS_WATCH_KEY)
    settings.add_on_change(SUBLIME_SETTINGS_WATCH_KEY, on_change_settings)
    logger.debug('loading initial settings')
    initial_settings = Settings(settings=settings)
    logger.debug(
        'triggering callback with initial settings: %s', initial_settings
    )
    callback(initial_settings)
    return initial_settings
def bind_on_change_settings ( callback , filename = SUBLIME_SETTINGS_FILENAME ) : logger . debug ( 'loading settings from: %s' , filename ) settings = sublime . load_settings ( filename ) def on_change_settings ( ) : logger . debug ( 'settings have changed, reloading them' ) settings = sublime . load_settings ( filename ) extracted_settings = Settings ( settings = settings ) callback ( extracted_settings ) logger . debug ( 'binding on-change handler using key: %r' , SUBLIME_SETTINGS_WATCH_KEY , ) settings . clear_on_change ( SUBLIME_SETTINGS_WATCH_KEY ) settings . add_on_change ( SUBLIME_SETTINGS_WATCH_KEY , on_change_settings ) logger . debug ( 'loading initial settings' ) initial_settings = Settings ( settings = settings ) logger . debug ( 'triggering callback with initial settings: %s' , initial_settings ) callback ( initial_settings ) return initial_settings
Binds `callback` to the on-change-settings event.
Binds ` callback ` to the on - change - settings event .
'''
    Binds `callback` to the on-change-settings event. The settings are loaded
    from `filename`, which should be the base name of the file (i.e. not the
    path to it). When loading, the settings are parsed into a `Settings`
    instance, and this instance is supplied as an argument to the callback.
    When called, this will automatically load the settings for the first time,
    and immediately invoke `callback` with the initial settings.
    '''
callback
filename