From e77bbc0af7cbd41e7cb0ffae2f1c926a45ca702b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 30 May 2018 09:09:31 +0200 Subject: [PATCH] part of #50760 --- .../parts/preferences/common/preferencesContribution.ts | 4 +++- .../workbench/services/textfile/common/textFileEditorModel.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts index 09d6aa2c742..2929ce2b291 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts @@ -21,6 +21,8 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IEditorOpeningEvent } from 'vs/workbench/common/editor'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { isEqual } from 'vs/base/common/paths'; +import { isLinux } from 'vs/base/common/platform'; const schemaRegistry = Registry.as(JSONContributionRegistry.Extensions.JSONContribution); @@ -79,7 +81,7 @@ export class PreferencesContribution implements IWorkbenchContribution { } // Global User Settings File - if (resource.fsPath === this.environmentService.appSettingsPath) { + if (isEqual(resource.fsPath, this.environmentService.appSettingsPath, !isLinux)) { return event.prevent(() => this.preferencesService.openGlobalSettings(event.options, event.position)); } diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 6b86202d1a1..8106f9cf483 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -32,6 +32,7 @@ import { ITextBufferFactory } from 'vs/editor/common/model'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; import { createTextBufferFactory } from 'vs/editor/common/model/textModel'; import { INotificationService } from 'vs/platform/notification/common/notification'; +import { isLinux } from 'vs/base/common/platform'; /** * The text file editor model listens to changes to its underlying code editor model and saves these changes through the file service back to the disk. @@ -780,7 +781,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil private isSettingsFile(): boolean { // Check for global settings file - if (this.resource.fsPath === this.environmentService.appSettingsPath) { + if (path.isEqual(this.resource.fsPath, this.environmentService.appSettingsPath, !isLinux)) { return true; }