提交 dd1cbbec 编写于 作者: E Eric Gang

Reserve revealed editor area after using git diff

fix the issue #53465
上级 28a82a6e
......@@ -230,7 +230,10 @@ export class CommandCenter {
}
if (!left) {
await commands.executeCommand<void>('vscode.open', right, opts);
const previousVisibleRanges = activeTextEditor.visibleRanges;
const document = await workspace.openTextDocument(right);
const editor = await window.showTextDocument(document, opts);
editor.revealRange(previousVisibleRanges[0]);
} else {
await commands.executeCommand<void>('vscode.diff', left, right, title, opts);
}
......@@ -577,7 +580,10 @@ export class CommandCenter {
opts.selection = activeTextEditor.selection;
}
await commands.executeCommand<void>('vscode.open', uri, opts);
const previousVisibleRanges = activeTextEditor.visibleRanges;
const document = await workspace.openTextDocument(uri);
const editor = await window.showTextDocument(document, opts);
editor.revealRange(previousVisibleRanges[0]);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册