Parcourir la 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 il y a 5 ans
Parent
commit
8613bccd8c
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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]);
+      }
     });
   }