def set_proper_scheme(view):
'''
this is callback, it is not meant to be called directly
view.settings().add_on_change('color_scheme', lambda: set_proper_scheme(view))
set once, right after view is created
_note_, color_scheme must not be set directly, but in a setting file
'''
# Since we cannot create file with syntax, there is moment when view has no settings,
# but it is activated, so some plugins (e.g. Color Highlighter) set wrong color scheme
if view.settings().get('outline_rename_mode', False):
outline_settings = sublime.load_settings('outline-rename-mode.sublime-settings')
else:
outline_settings = sublime.load_settings('outline.sublime-settings')
if view.settings().get('color_scheme') == outline_settings.get('color_scheme'):
return
view.settings().set('color_scheme', outline_settings.get('color_scheme'))
评论列表
文章目录