Browse Source

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 years ago
parent
commit
8613bccd8c
1 changed files with 5 additions and 1 deletions
  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]);
+      }
     });
   }