From 0ca196a5cd4af9529334348f44873b7868b53b90 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 18 Oct 2018 11:42:43 +0200 Subject: [PATCH] Save file dialog initialized with the filesystem root. Fixes #60939 --- src/vs/workbench/services/textfile/common/textFileService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index e551eaa5671..766d4e482b3 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -32,7 +32,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c import { createTextBufferFactoryFromSnapshot } from 'vs/editor/common/model/textModel'; import { IModelService } from 'vs/editor/common/services/modelService'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { isEqualOrParent, isEqual, joinPath } from 'vs/base/common/resources'; +import { isEqualOrParent, isEqual, joinPath, dirname } from 'vs/base/common/resources'; export interface IBackupResult { didBackup: boolean; @@ -630,7 +630,8 @@ export abstract class TextFileService extends Disposable implements ITextFileSer const lastActiveFile = this.historyService.getLastActiveFile(schemeFilter); if (lastActiveFile) { - return joinPath(lastActiveFile, untitledFileName); + const lastDir = dirname(lastActiveFile); + return joinPath(lastDir, untitledFileName); } const lastActiveFolder = this.historyService.getLastActiveWorkspaceRoot(schemeFilter);