Sfoglia il codice sorgente

Avoids adding settings for defaults

main
Eric Amodio 6 anni fa
parent
commit
4bd4e71704
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. +7
    -1
      src/pageProvider.ts

+ 7
- 1
src/pageProvider.ts Vedi 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);
}
}
}

Caricamento…
Annulla
Salva