Browse Source

Avoids adding settings for defaults

main
Eric Amodio 7 years ago
parent
commit
4bd4e71704
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/pageProvider.ts

+ 7
- 1
src/pageProvider.ts View File

@ -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);
}
}
}

Loading…
Cancel
Save