当前位置: 首页>>代码示例>>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;未经允许,请勿转载。