diff --git a/edit/source-editor.js b/edit/source-editor.js index 660b26f8..f8a52c93 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -49,7 +49,6 @@ function createSourceEditor(style) { const cm = CodeMirror.fromTextArea($('#sections textarea')); // too many functions depend on this global editors.push(cm); - cm.focus(); // draw metas info updateMeta(); @@ -60,6 +59,9 @@ function createSourceEditor(style) { initLint(); initLinterSwitch(); + // focus must be the last action, otherwise the style is duplicated on saving + cm.focus(); + function initAppliesToLineWidget() { const PREF_NAME = 'editor.appliesToLineWidget'; const widget = createAppliesToLineWidget(cm);