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)"""
评论列表
文章目录