本文整理匯總了Python中sublime.View.add_regions方法的典型用法代碼示例。如果您正苦於以下問題:Python View.add_regions方法的具體用法?Python View.add_regions怎麽用?Python View.add_regions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sublime.View
的用法示例。
在下文中一共展示了View.add_regions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update_diagnostics_regions
# 需要導入模塊: from sublime import View [as 別名]
# 或者: from sublime.View import add_regions [as 別名]
def update_diagnostics_regions(view: sublime.View, diagnostics: 'List[Diagnostic]', severity: int):
region_name = "code_intel_" + format_severity(severity)
if settings.show_diagnostics_phantoms and not view.is_dirty():
regions = None
else:
regions = list(range_to_region(diagnostic.range, view) for diagnostic in diagnostics
if diagnostic.severity == severity)
if regions:
scope_name = diagnostic_severity_scopes[severity]
view.add_regions(
region_name, regions, scope_name, settings.diagnostics_gutter_marker,
UNDERLINE_FLAGS if settings.diagnostics_highlight_style == "underline" else BOX_FLAGS)
else:
view.erase_regions(region_name)