瀏覽代碼

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 年之前
父節點
當前提交
8613bccd8c
共有 1 個文件被更改,包括 5 次插入1 次删除
  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]);
+      }
     });
   }