当前位置: 首页>>代码示例>>Python>>正文


Python sublime.DRAW_NO_FILL属性代码示例

本文整理汇总了Python中sublime.DRAW_NO_FILL属性的典型用法代码示例。如果您正苦于以下问题:Python sublime.DRAW_NO_FILL属性的具体用法?Python sublime.DRAW_NO_FILL怎么用?Python sublime.DRAW_NO_FILL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在sublime的用法示例。


在下文中一共展示了sublime.DRAW_NO_FILL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: visible

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [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: __init__

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def __init__(self, component: Union[span, div], view: sublime.View, region: sublime.Region, layout: int = sublime.LAYOUT_INLINE) -> None:
		super().__init__(component, view)
		self.cachedPhantom = None #type: Optional[sublime.Phantom]
		self.region = region
		self.layout = layout
		self.view = view

		self.set = sublime.PhantomSet(self.view)

		Phantom.id += 1

		# we use the region to track where we should place the new phantom so if text is inserted the phantom will be redrawn in the correct place
		self.region_id = 'phantom_{}'.format(Phantom.id)
		self.view.add_regions(self.region_id, [self.region], flags=sublime.DRAW_NO_FILL)
		self.update()
		_renderables_add.append(self) 
开发者ID:daveleroy,项目名称:sublime_debugger,代码行数:18,代码来源:render.py

示例3: highlight_problems

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def highlight_problems(self, view, problems):
        view.erase_regions('clang-code-errors')
        view_id = view.id()
        view_cache = {}
        regions = []
        for problem in problems:
            lineno = problem['location']['line_num']
            colno = problem['location']['column_num']
            line_regions = view_cache.setdefault(lineno - 1, {})
            message = ERROR_MESSAGE_TEMPLATE.format(**problem)
            print(PRINT_ERROR_MESSAGE_TEMPLATE.format(message, lineno, colno))
            region = view.word(view.text_point(lineno - 1, colno - 1))
            regions.append(region)
            line_regions[(region.a, region.b)] = message
        self.view_cache[view_id] = view_cache
        style = (sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE |
                 sublime.DRAW_SQUIGGLY_UNDERLINE)
        view.add_regions(
            'clang-code-errors', regions, 'invalid', ERROR_MARKER_IMG, style) 
开发者ID:LuckyGeck,项目名称:YcmdCompletion,代码行数:21,代码来源:Completion.py

示例4: set_bookmarks

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def set_bookmarks(set_dot = False, erase_regions = True):
  global bookmarks
  view = sublime.active_window().active_view()
  
  if util.is_project_view(view) and util.is_javascript_project() :
    project_settings = util.get_project_settings()
    bookmarks = util.open_json(os.path.join(project_settings["settings_dir_name"], 'bookmarks.json')) or dict()
  else :
    sublime.error_message("Can't recognize JavaScript Project.")
    return

  if erase_regions:
    view.erase_regions("javascript_enhancements_region_bookmarks")
    if set_dot :
      lines = []
      lines = [view.line(view.text_point(bookmark_line, 0)) for bookmark_line in search_bookmarks_by_view(view, is_from_set = True)]
      view.add_regions("javascript_enhancements_region_bookmarks", lines,  "code", "bookmark", sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE) 
开发者ID:pichillilorenzo,项目名称:JavaScriptEnhancements,代码行数:19,代码来源:bookmarks.py

示例5: update_bookmarks

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def update_bookmarks(set_dot = False, erase_regions = True):
  global bookmarks
  path = ""
  view = sublime.active_window().active_view()

  if util.is_project_view(view) and util.is_javascript_project() :
    project_settings = util.get_project_settings()
    path = os.path.join(project_settings["settings_dir_name"], 'bookmarks.json')
  else :
    sublime.error_message("Can't recognize JavaScript Project.")
    return

  with open(path, 'w+', encoding="utf-8") as bookmarks_json:
    bookmarks_json.write(json.dumps(bookmarks))

  if erase_regions:
    view.erase_regions("javascript_enhancements_region_bookmarks")
    if set_dot :
      lines = []
      lines = [view.line(view.text_point(bookmark_line, 0)) for bookmark_line in search_bookmarks_by_view(view)]
      view.add_regions("javascript_enhancements_region_bookmarks", lines,  "code", "bookmark", sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE) 
开发者ID:pichillilorenzo,项目名称:JavaScriptEnhancements,代码行数:23,代码来源:bookmarks.py

示例6: display_previews

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def display_previews(view, previews, pt=-1, current_index=0):
    global phantom_sets_by_buffer
    buffer_id = view.buffer_id()

    if (
        buffer_id in phantom_sets_by_buffer
        and pt != phantom_sets_by_buffer[buffer_id][1]
    ):
        return

    preview_html, preview_regions = generate_previews(previews, current_index)
    on_navigate = get_on_navigate(view, previews, current_index, pt)
    view.add_regions(
        "cfml_method_preview",
        merge_regions(preview_regions),
        "source",
        flags=sublime.DRAW_NO_FILL,
    )

    phantom_set = sublime.PhantomSet(view, "cfml_method_preview")
    phantom_sets_by_buffer[buffer_id] = (phantom_set, pt)
    phantom = sublime.Phantom(
        view.line(pt), preview_html, sublime.LAYOUT_BLOCK, on_navigate
    )
    phantom_set.update([phantom]) 
开发者ID:jcberquist,项目名称:sublimetext-cfml,代码行数:27,代码来源:method_preview.py

示例7: hidden

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def hidden():
    flags = 0
    if _st_version < 3000:
        flags = sublime.HIDDEN
    else:
        flags = (sublime.DRAW_NO_FILL |
                 sublime.DRAW_NO_OUTLINE)

    return (flags | sublime.HIDE_ON_MINIMAP) 
开发者ID:sascha-wolf,项目名称:sublime-GitConflictResolver,代码行数:11,代码来源:drawing_flags.py

示例8: on_idle

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def on_idle(self, view):
        """
        """
        structure_info = self._get_structure_info(view)
        linting = self.get_settings(view, "linting", True)

        # linting
        if linting and "key.diagnostics" in structure_info:
            diagnostics = structure_info["key.diagnostics"]
            self.errors = {}

            for entry in diagnostics:
                description = entry["key.description"]
                #level = entry['key.severity']
                row, col = entry["key.line"], entry["key.column"]
                pos = view.text_point(row-1,col-1)

                self.errors[pos] = description

            view.add_regions(
                "swiftkitten.diagnostics",
                [Region(pos,pos+1) for pos in self.errors.keys()],
                "constant",
                "",
                sublime.DRAW_STIPPLED_UNDERLINE | sublime.DRAW_NO_OUTLINE | sublime.DRAW_NO_FILL
            )

            self._update_linting_status(view) 
开发者ID:johncsnyder,项目名称:SwiftKitten,代码行数:30,代码来源:SwiftKitten.py

示例9: run

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def run(self, edit) :
      global region_selected
      view = self.view
      lines = view.lines(region_selected)
      view.add_regions("region-dot", [lines[0], lines[-1:][0]],  "code", "dot", sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE)
      #view.add_regions("region-body", [region_selected],  "code", "", sublime.DRAW_NO_FILL) 
开发者ID:pichillilorenzo,项目名称:JavaScript-Completions,代码行数:8,代码来源:_generated_2018_02_11_at_20_21_24.py

示例10: append

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def append(self, data):
		view = self.buildResultPanel
		view.run_command("append", {"characters": data})

		codePoints = view.find_by_selector("constant.numeric.line-number.match.find-in-files")
		lines = []
		for codePoint in codePoints:
			lines.append(view.line(codePoint))

		view.add_regions("errors", lines, "keyword", "bookmark", 
			sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.PERSISTENT | sublime.DRAW_SQUIGGLY_UNDERLINE) 
开发者ID:fuse-open,项目名称:Fuse.SublimePlugin,代码行数:13,代码来源:build_results.py

示例11: mark

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def mark(self, view: sublime.View):
        "Marks tracker in given view"
        scope = emmet.get_settings('marker_scope', 'region.accent')
        mark_opt = sublime.DRAW_SOLID_UNDERLINE | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE
        view.erase_regions(ABBR_REGION_ID)
        view.add_regions(ABBR_REGION_ID, [self.region], scope, '', mark_opt)
        if self.forced:
            phantoms = [sublime.Phantom(self.region, forced_indicator('⋮>'), sublime.LAYOUT_INLINE)]
            if not self.forced_indicator:
                self.forced_indicator = sublime.PhantomSet(view, ABBR_REGION_ID)
            self.forced_indicator.update(phantoms) 
开发者ID:emmetio,项目名称:sublime-text-plugin,代码行数:13,代码来源:tracker.py

示例12: mark

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def mark(editor: sublime.View, tracker: AbbreviationTracker):
    "Marks tracker in given view"
    scope = get_settings('marker_scope', 'region.accent')
    mark_opt = sublime.DRAW_SOLID_UNDERLINE | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE
    editor.erase_regions(ABBR_REGION_ID)
    editor.add_regions(ABBR_REGION_ID, [tracker.region], scope, '', mark_opt)
    if isinstance(tracker, AbbreviationTrackerValid) and tracker.forced:
        phantoms = [
            sublime.Phantom(tracker.region, forced_indicator('⋮>'), sublime.LAYOUT_INLINE)
        ]

        key = editor.id()
        if key not in _forced_indicator:
            _forced_indicator[key] = sublime.PhantomSet(editor, ABBR_REGION_ID)
        _forced_indicator[key].update(phantoms) 
开发者ID:emmetio,项目名称:sublime-text-plugin,代码行数:17,代码来源:abbreviation.py

示例13: markLine

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def markLine(self,view, line_number):
		self.clear(view)
		print(line_number)
		region = view.text_point(line_number-1, 0)
		line = view.line(region)
		view.add_regions(
			'jsx_error', 
			[line], 
			'keyword', 
			'dot', 
			sublime.DRAW_NO_FILL
		) 
开发者ID:vamitul,项目名称:RunInIndesign,代码行数:14,代码来源:runInIndesign.py

示例14: _handle_response

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def _handle_response(self, response: Optional[List]) -> None:
        if not response:
            return
        kind2regions = {}  # type: Dict[str, List[sublime.Region]]
        for kind in range(0, 4):
            kind2regions[_kind2name[kind]] = []
        for highlight in response:
            r = range_to_region(Range.from_lsp(highlight["range"]), self.view)
            kind = highlight.get("kind", DocumentHighlightKind.Unknown)
            if kind is not None:
                kind2regions[_kind2name[kind]].append(r)
        if settings.document_highlight_style == "fill":
            flags = 0
        elif settings.document_highlight_style == "box":
            flags = sublime.DRAW_NO_FILL
        else:
            flags = sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE
            if settings.document_highlight_style == "underline":
                flags |= sublime.DRAW_SOLID_UNDERLINE
            elif settings.document_highlight_style == "stippled":
                flags |= sublime.DRAW_STIPPLED_UNDERLINE
            elif settings.document_highlight_style == "squiggly":
                flags |= sublime.DRAW_SQUIGGLY_UNDERLINE

        self._clear_regions()
        for kind_str, regions in kind2regions.items():
            if regions:
                scope = settings.document_highlight_scopes.get(kind_str, None)
                if scope:
                    self.view.add_regions("lsp_highlight_{}".format(kind_str),
                                          regions, scope=scope, flags=flags) 
开发者ID:sublimelsp,项目名称:LSP,代码行数:33,代码来源:highlights.py

示例15: on_highlighted

# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import DRAW_NO_FILL [as 别名]
def on_highlighted(self, index: int) -> None:
        if self.is_first_selection:
            self.is_first_selection = False
            return
        region = self.region(index)
        self.view.show_at_center(region.a)
        self.view.add_regions(self.REGIONS_KEY, [region], 'comment', '', sublime.DRAW_NO_FILL) 
开发者ID:sublimelsp,项目名称:LSP,代码行数:9,代码来源:symbols.py


注:本文中的sublime.DRAW_NO_FILL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。