From 28c73406081eb7c143629e2dd7cef3a93a24af86 Mon Sep 17 00:00:00 2001 From: Robert Beach Date: Mon, 18 Jan 2021 08:28:29 -0800 Subject: [PATCH 1/2] Fix Close Folder/Workspace (#2532) When you choose to close the current folder, it doesn't close properly because the lastVisiited setting is still use. This fixes that. --- src/node/vscode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/vscode.ts b/src/node/vscode.ts index e382d59b2..d7a329832 100644 --- a/src/node/vscode.ts +++ b/src/node/vscode.ts @@ -43,7 +43,7 @@ export class VscodeProvider { options.args._ && options.args._.length > 0 ? { url: path.resolve(options.args._[options.args._.length - 1]) } : undefined, - !options.args["ignore-last-opened"] ? lastVisited : undefined, + !options.args["ignore-last-opened"] && !query.ew ? lastVisited : undefined, ]) settings.write({ From d234ddc1e1d4f9c0fe963e63095864410977d969 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Mon, 18 Jan 2021 11:29:18 -0500 Subject: [PATCH 2/2] vscode.ts: Fix close current folder Fixes VscodeProvider to correctly obey the ew parameter. Based on changes by @rdbeach. See the previous commit. --- src/node/vscode.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node/vscode.ts b/src/node/vscode.ts index d7a329832..efdd74cad 100644 --- a/src/node/vscode.ts +++ b/src/node/vscode.ts @@ -37,15 +37,19 @@ export class VscodeProvider { query: ipc.Query, ): Promise { const { lastVisited } = await settings.read() - const startPath = await this.getFirstPath([ + let startPath = await this.getFirstPath([ { url: query.workspace, workspace: true }, { url: query.folder, workspace: false }, options.args._ && options.args._.length > 0 ? { url: path.resolve(options.args._[options.args._.length - 1]) } : undefined, - !options.args["ignore-last-opened"] && !query.ew ? lastVisited : undefined, + !options.args["ignore-last-opened"] ? lastVisited : undefined, ]) + if (query.ew) { + startPath = undefined + } + settings.write({ lastVisited: startPath, query,