提交 d572f432 编写于 作者: J Joao Moreno

wip: git: send pngs as data uris

上级 1a595ca4
......@@ -184,7 +184,25 @@ export class CommandCenter {
}
if (!left) {
if (right.scheme === 'git') {
const repository = this.model.getRepository(right);
if (repository) {
const { path, ref } = fromGitUri(right);
if (/png$/i.test(path)) {
const contents = await repository.show(ref, path);
const buffer = new Buffer(contents);
const uri = `data:data:image/png;base64,${buffer.toString('base64')}`;
await commands.executeCommand<void>('vscode.open', uri, opts);
return;
}
}
}
await commands.executeCommand<void>('vscode.open', right, opts);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册