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


Python sublime.DRAW_OUTLINED屬性代碼示例

本文整理匯總了Python中sublime.DRAW_OUTLINED屬性的典型用法代碼示例。如果您正苦於以下問題:Python sublime.DRAW_OUTLINED屬性的具體用法?Python sublime.DRAW_OUTLINED怎麽用?Python sublime.DRAW_OUTLINED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在sublime的用法示例。


在下文中一共展示了sublime.DRAW_OUTLINED屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: visible

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import DRAW_OUTLINED [as 別名]
def visible():
    fill = settings.get('fill_conflict_area')
    outline = settings.get('outline_conflict_area')

    flags = 0
    if _st_version < 3000:
        # If fill is set then outline is ignored; ST2 doesn't provide a combination
        if not (fill or outline):
            flags = sublime.HIDDEN
        elif not fill and outline:
            flags = sublime.DRAW_OUTLINED
    else:
        if not fill:
            flags |= sublime.DRAW_NO_FILL
        if not outline:
            flags |= sublime.DRAW_NO_OUTLINE

    return flags 
開發者ID:sascha-wolf,項目名稱:sublime-GitConflictResolver,代碼行數:20,代碼來源:drawing_flags.py

示例2: show_output

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import DRAW_OUTLINED [as 別名]
def show_output(view):
    output_str = view.settings().get(COALA_KEY + ".output_str")
    if not output_str:
        return
    output = json.loads(output_str)

    region_flag = sublime.DRAW_OUTLINED
    regions = []

    for section_name, section_results in output["results"].items():
        for result in section_results:
            if not result["affected_code"]:
                continue
            for code_region in result["affected_code"]:
                line = view.line(
                    view.text_point(code_region["start"]["line"]-1, 0))
                regions.append(line)

    view.add_regions(COALA_KEY, regions, COALA_KEY, "dot", region_flag) 
開發者ID:coala,項目名稱:coala-sublime,代碼行數:21,代碼來源:CoalaCommand.py

示例3: draw_difference

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import DRAW_OUTLINED [as 別名]
def draw_difference(self, view, diffs):
        self.clear(view)

        lines = [d.get_region(view) for d in diffs]

        view.add_regions(
            'highlighted_lines', 
            lines, 
            'keyword', 
            'dot', 
            sublime.DRAW_OUTLINED
        )

        return lines 
開發者ID:zsong,項目名稱:diffy,代碼行數:16,代碼來源:diffy.py

示例4: mark_vul

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import DRAW_OUTLINED [as 別名]
def mark_vul(self, view):
        global g_regions
        #print([self.data[i]["discription"] for i in self.data])
        if not self.lang or not self.data:
            return
        for key,val in self.data.items():
            if not val['enable']: continue
            vul = view.find_all(val['pattern'])
            if not vul: continue
            for i in vul:
                i.a += val["abais"]
                i.b += val["bbais"]
            view.add_regions(key, vul, "string", "cross", sublime.DRAW_OUTLINED|sublime.DRAW_STIPPLED_UNDERLINE)
            g_regions.append(key) 
開發者ID:5alt,項目名稱:VulHint,代碼行數:16,代碼來源:VulHint.py

示例5: show_references_panel

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import DRAW_OUTLINED [as 別名]
def show_references_panel(self, references_by_file: Dict[str, List[Tuple[Point, str]]]) -> None:
        window = self.view.window()
        if window:
            panel = ensure_references_panel(window)
            if not panel:
                return

            text = ''
            references_count = 0
            for file, references in references_by_file.items():
                text += '◌ {}:\n'.format(self.get_relative_path(file))
                for reference in references:
                    references_count += 1
                    point, line = reference
                    text += '\t{:>8}:{:<4} {}\n'.format(point.row + 1, point.col + 1, line)
                # append a new line after each file name
                text += '\n'

            base_dir = windows.lookup(window).get_project_path(self.view.file_name() or "")
            panel.settings().set("result_base_dir", base_dir)

            panel.run_command("lsp_clear_panel")
            window.run_command("show_panel", {"panel": "output.references"})
            panel.run_command('append', {
                'characters': "{} references for '{}'\n\n{}".format(references_count, self.word, text),
                'force': True,
                'scroll_to_end': False
            })

            # highlight all word occurrences
            regions = panel.find_all(r"\b{}\b".format(self.word))
            panel.add_regions('ReferenceHighlight', regions, 'comment', flags=sublime.DRAW_OUTLINED) 
開發者ID:sublimelsp,項目名稱:LSP,代碼行數:34,代碼來源:references.py


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