本文整理汇总了Python中sublime.View.is_dirty方法的典型用法代码示例。如果您正苦于以下问题:Python View.is_dirty方法的具体用法?Python View.is_dirty怎么用?Python View.is_dirty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sublime.View
的用法示例。
在下文中一共展示了View.is_dirty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_diagnostics_regions
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import is_dirty [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)
示例2: update_diagnostics_phantoms
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import is_dirty [as 别名]
def update_diagnostics_phantoms(view: sublime.View, diagnostics: 'List[Diagnostic]'):
global phantom_sets_by_buffer
buffer_id = view.buffer_id()
if not settings.show_diagnostics_phantoms or view.is_dirty():
phantoms = None
else:
phantoms = list(
create_phantom(view, diagnostic) for diagnostic in diagnostics)
if phantoms:
phantom_set = phantom_sets_by_buffer.get(buffer_id)
if not phantom_set:
phantom_set = sublime.PhantomSet(view, "code_intel_diagnostics")
phantom_sets_by_buffer[buffer_id] = phantom_set
phantom_set.update(phantoms)
else:
phantom_sets_by_buffer.pop(buffer_id, None)