def update_gutter_marks(self):
"""Update the gutter mark info based on the the current "gutter_theme" setting."""
theme_path = self.settings.get('gutter_theme', DEFAULT_GUTTER_THEME_PATH)
theme = os.path.splitext(os.path.basename(theme_path))[0]
if theme_path.lower() == 'none':
gutter_marks['warning'] = gutter_marks['error'] = ''
return
info = None
for path in (theme_path, DEFAULT_GUTTER_THEME_PATH):
try:
info = sublime.load_resource(path)
break
except IOError:
pass
if info is not None:
if theme != 'Default' and os.path.basename(path) == 'Default.gutter-theme':
printf('cannot find the gutter theme \'{}\', using the default'.format(theme))
path = os.path.dirname(path)
for error_type in ('warning', 'error'):
icon_path = '{}/{}.png'.format(path, error_type)
gutter_marks[error_type] = icon_path
try:
info = json.loads(info)
colorize = info.get('colorize', False)
except ValueError:
colorize = False
gutter_marks['colorize'] = colorize
else:
sublime.error_message(
'SublimeLinter: cannot find the gutter theme "{}",'
' and the default is also not available. '
'No gutter marks will display.'.format(theme)
)
gutter_marks['warning'] = gutter_marks['error'] = ''
评论列表
文章目录