當前位置: 首頁>>代碼示例>>Python>>正文


Python View.is_dirty方法代碼示例

本文整理匯總了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)
開發者ID:Kronuz,項目名稱:SublimeCodeIntel,代碼行數:16,代碼來源:diagnostics.py

示例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)
開發者ID:Kronuz,項目名稱:SublimeCodeIntel,代碼行數:19,代碼來源:diagnostics.py


注:本文中的sublime.View.is_dirty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。