mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 21:41:46 +01:00
fix #30674 for real
This commit is contained in:
@@ -362,23 +362,18 @@ export class CommandCenter {
|
||||
const preview = uris.length === 1 ? true : false;
|
||||
const activeTextEditor = window.activeTextEditor;
|
||||
for (const uri of uris) {
|
||||
// If the active editor matches the current uri, get its selection
|
||||
const selections = activeTextEditor && activeTextEditor.document.uri.toString() === uri.toString()
|
||||
? activeTextEditor.selections
|
||||
: undefined;
|
||||
|
||||
const opts: TextDocumentShowOptions = {
|
||||
preserveFocus,
|
||||
preview: preview,
|
||||
viewColumn: activeTextEditor && activeTextEditor.viewColumn || ViewColumn.One
|
||||
};
|
||||
|
||||
if (activeTextEditor && activeTextEditor.document.uri.toString() === uri.toString()) {
|
||||
opts.selection = activeTextEditor.selection;
|
||||
}
|
||||
|
||||
const document = await workspace.openTextDocument(uri);
|
||||
await window.showTextDocument(document, opts);
|
||||
|
||||
if (selections && window.activeTextEditor) {
|
||||
window.activeTextEditor.selections = selections;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user