From 4bd4e717043159bc0336ef5a18704b2313a0af43 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 2 Feb 2018 14:08:16 -0500 Subject: [PATCH] Avoids adding settings for defaults --- src/pageProvider.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pageProvider.ts b/src/pageProvider.ts index 10bdff5..cff9ebb 100644 --- a/src/pageProvider.ts +++ b/src/pageProvider.ts @@ -52,7 +52,13 @@ export class PageProvider extends Disposable implements TextDocumentContentProvi Logger.log(`PageProvider.save: changes=${JSON.stringify(changes)}`); for (const key in changes) { - await configuration.update(key, changes[key], ConfigurationTarget.Global); + const inspect = await configuration.inspect(key)!; + if (inspect.defaultValue === changes[key]) { + await configuration.update(key, undefined, ConfigurationTarget.Global); + } + else { + await configuration.update(key, changes[key], ConfigurationTarget.Global); + } } }