提交 06a2f97a 编写于 作者: B Benjamin Pasero

opening a file using code --wait does not wait to quit (fixes #35049)

上级 8aede05f
......@@ -514,7 +514,7 @@ export class WindowsManager implements IWindowsMainService {
// Find suitable window or folder path to open files in
const fileToCheck = filesToOpen[0] || filesToCreate[0] || filesToDiff[0];
const bestWindowOrFolder = findBestWindowOrFolderForFile({
let bestWindowOrFolder = findBestWindowOrFolderForFile({
windows: WindowsManager.WINDOWS,
newWindow: openFilesInNewWindow,
reuseWindow: openConfig.forceReuseWindow,
......@@ -524,6 +524,12 @@ export class WindowsManager implements IWindowsMainService {
workspaceResolver: workspace => this.workspacesService.resolveWorkspaceSync(workspace.configPath)
});
// Special case: we started with --wait and we got back a folder to open. In this case
// we actually prefer to not open the folder but operate purely on the file.
if (typeof bestWindowOrFolder === 'string' && filesToWait) {
bestWindowOrFolder = !openFilesInNewWindow ? this.getLastActiveWindow() : null;
}
// We found a window to open the files in
if (bestWindowOrFolder instanceof CodeWindow) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册