Ver código fonte

Support transient editor configs

Currently when global file editor settings are changed the transient
editor specifc settings are reset to thier default global values.

Now the transient editor specific configs are skipped when the global
settings updates are applied to each editor's configs
Alex Bozarth 5 anos atrás
pai
commit
8613bccd8c
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      packages/fileeditor-extension/src/commands.ts

+ 5 - 1
packages/fileeditor-extension/src/commands.ts

@@ -147,11 +147,15 @@ export namespace Commands {
 
   /**
    * Update the settings of a widget.
+   * Skip global settings for transient editor specific configs.
    */
   export function updateWidget(widget: FileEditor): void {
+    const transientConfigs = ['lineNumbers', 'lineWrap', 'matchBrackets'];
     const editor = widget.editor;
     Object.keys(config).forEach((key: keyof CodeEditor.IConfig) => {
-      editor.setOption(key, config[key]);
+      if (!transientConfigs.includes(key)) {
+        editor.setOption(key, config[key]);
+      }
     });
   }