diff --git a/edit/source-editor.js b/edit/source-editor.js index 5cdd60d2..3f7d51f2 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -43,13 +43,14 @@ function createSourceEditor(style) { } const cm = CodeMirror.fromTextArea($('#sections textarea')); - cm.startOperation(); + editors.push(cm); updateMeta().then(() => { + initLint(); + initLinterSwitch(); + cm.setValue(style.sourceCode); cm.clearHistory(); cm.markClean(); - editors.push(cm); - cm.endOperation(); initHooks(); initAppliesToLineWidget(); @@ -58,9 +59,6 @@ function createSourceEditor(style) { cm.focus(); }); - initLint(); - initLinterSwitch(); - function initAppliesToLineWidget() { const PREF_NAME = 'editor.appliesToLineWidget'; const widget = createAppliesToLineWidget(cm); @@ -104,6 +102,7 @@ function createSourceEditor(style) { update(); }); linterEl.addEventListener('change', update); + update(); function update() { linterEl.value = linterConfig.getDefault();