def get_option(view, name):
    # TODO: Should probably return global, local values.
    try:
        option_data = VI_OPTIONS[name]
    except KeyError:
        raise KeyError('not a vi editor option')

    if option_data.scope == SCOPE_WINDOW:
        value = view.window().settings().get('vintageous_' + name)
    else:
        value = view.settings().get('vintageous_' + name)
    return value if (value in option_data.values) else option_data.default
dataset/ETHPy150Open guillermooo/Vintageous/vi/settings.py/get_option/original