From 15c98bac9ee3b31603bc2aee1bac1875f5c4af59 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 15 Nov 2017 11:33:37 +0300 Subject: [PATCH] fixup 8ca7c363: focus() must be the last action --- edit/source-editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);