SideBar.py 文件源码

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

项目:.sublime 作者: cxdongjack 项目源码 文件源码
def on_load_async(self, view):
        if view and view.file_name() and not view.settings().get('open_with_edit'):
            item = SideBarItem(os.path.join(sublime.packages_path(), 'User', 'SideBarEnhancements', 'Open With', 'Side Bar.sublime-menu'), False)
            if item.exists():
                settings = sublime.decode_value(item.contentUTF8())
                selection = SideBarSelection([view.file_name()])
                for item in settings[0]['children']:
                    try:
                        if item['open_automatically'] and selection.hasFilesWithExtension(item['args']['extensions']):
                            SideBarFilesOpenWithCommand(sublime_plugin.WindowCommand).run([view.file_name()], item['args']['application'], item['args']['extensions'])
                            view.window().run_command('close')
                            break
                    except:
                        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号