commands.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:NeoVintageous 作者: NeoVintageous 项目源码 文件源码
def run(self):
        view = self.window.active_view()
        pt = view.sel()[0]
        scope = view.scope_name(pt.begin()).rstrip()

        # TODO Fix jumptags scopes (rename them to less generic scopes)
        jumptag_scopes = [
            'text.neovintageous.help string.neovintageous',
            'text.neovintageous.help support.constant.neovintageous'
        ]

        if scope not in jumptag_scopes:
            return

        subject = view.substr(view.extract_scope(pt.begin()))

        if len(subject) < 3:
            return

        match = re.match('^\'[a-z_]+\'|\\|[^\\s\\|]+\\|$', subject)
        if match:
            subject = subject.strip('|')
            # TODO Refactor ex_help code into a reusable middle layer so that
            # this command doesn't have to call the ex command.
            self.window.run_command('ex_help', {'command_line': 'help ' + subject})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号