From d234ddc1e1d4f9c0fe963e63095864410977d969 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Mon, 18 Jan 2021 11:29:18 -0500 Subject: [PATCH] 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,