Python sublime 模块,HIDE_ON_MINIMAP 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用sublime.HIDE_ON_MINIMAP

项目:npm-install    作者:fcannizzaro    | 项目源码 | 文件源码
def update_icons(view):

    file = view.file_name()

    modules = []
    installed = []
    other = []
    result = []

    if file not in data:
        view.run_command('npm_install', {'action': 'initial'})
    else:
        modules = data[file]

    for region in view.find_all(MODULE):
        m = re.search(MODULE, view.substr(region))
        a, b = m.span(1)
        module = m.group(1)
        reg = Region(a + region.begin(), b + region.begin())
        if module in modules or module in CORE:
            installed.append(reg)
        else:
            other.append(reg)
            result.append(module)

    flags = sublime.HIDE_ON_MINIMAP | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE
    view.add_regions('require-on', installed, 'request', ICON % 'on', flags)
    view.add_regions('require-off', other, 'request', ICON % 'off', flags)

    return result
项目:SublimeReddit    作者:deoxxa    | 项目源码 | 文件源码
def draw_t1(self, edit, view, item, indent):
        created = item.get('created_utc', None)
        if created is not None:
            created = datetime.datetime.fromtimestamp(
                created).strftime('%A, %d. %B %Y %I:%M%p')

        title_start = view.size()
        view.insert(edit, view.size(), '%s# [%d] [%s] %s' % (
            indent[2:], item.get('score', 0), item.get('author', ''), created))
        title_end = view.size()
        view.insert(edit, view.size(), '\n\n')
        view.add_regions(
            'thread-%s-title' % (item.get('id', '')),
            [sublime.Region(title_start, title_end)],
            'thread-title',
            'dot',
            flags=sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE
        )

        content = wrap(unescape(item.get('body', '')).strip(), indent)

        content_start = view.size()
        view.insert(edit, view.size(), content)
        content_end = view.size() - 1
        view.insert(edit, view.size(), '\n\n')
        view.add_regions(
            'thread-%s-body' % item.get('id', ''),
            [sublime.Region(content_start, content_end)],
            'thread-body',
            flags=sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.HIDE_ON_MINIMAP
        )

        replies = item.get('replies', {})
        if isinstance(replies, dict):
            for child in replies.get('data', {}).get('children', []):
                self.draw_item(edit, view, child, indent + '  ')
项目:SublimeReddit    作者:deoxxa    | 项目源码 | 文件源码
def draw_t3(self, edit, view, item, indent):
        title_start = view.size()
        view.insert(edit, view.size(), '# [%s] [%5d] %s' % (
            item.get('id', ''), item.get('score', 0), item.get('title', '???')))
        title_end = view.size()
        view.insert(edit, view.size(), '\n\n')
        view.add_regions(
            'thread-%s-title' % (item.get('id', '')),
            [sublime.Region(title_start, title_end)],
            'thread-title',
            'bookmark',
            flags=sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_SOLID_UNDERLINE
        )

        content = wrap(unescape(item.get('selftext', '')).strip(), indent)

        content_start = view.size()
        view.insert(edit, view.size(), content)
        content_end = view.size() - 1
        view.insert(edit, view.size(), '\n\n')
        view.add_regions(
            'thread-%s-body' % item.get('id', ''),
            [sublime.Region(content_start, content_end)],
            'thread-body',
            flags=sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.HIDE_ON_MINIMAP
        )