當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。