kt_git.py 文件源码

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

项目:sublimeplugins 作者: ktuan89 项目源码 文件源码
def click(self, link):
        path = gitPath(self.view.window())
        command = ("cd '{0}';git show {1}").format(path, link)

        stdout, _ = run_bash_for_output(command)

        window = self.view.window()
        results_view = window.new_file()
        results_view.set_scratch(True)
        results_view.set_syntax_file('Packages/Diff/Diff.tmLanguage')

        results_view.set_name('GitBlame')

        # deps: this is from utilities.py
        results_view.run_command('replace_content', {"new_content": stdout})
        results_view.sel().clear()
        results_view.sel().add(sublime.Region(0, 0))

        window.focus_view(results_view)

        """for line in lines:
            matches = re.search(r'Differential Revision: (http.*/D[0-9]+)', line)
            if matches is not None:
                actual_link = matches.group(1)
                webbrowser.open_new(actual_link)"""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号