speedup usercss opening: combine a few ops

This commit is contained in:
tophf 2017-11-15 11:35:54 +03:00
parent 15c98bac9e
commit 5a9227ce8c

View File

@ -45,13 +45,19 @@ function createSourceEditor(style) {
}
// draw CodeMirror
$('#sections textarea').value = style.sourceCode;
const cm = CodeMirror.fromTextArea($('#sections textarea'));
cm.startOperation();
cm.setValue(style.sourceCode);
cm.clearHistory();
cm.markClean();
// too many functions depend on this global
editors.push(cm);
// draw metas info
updateMeta();
cm.endOperation();
initHooks();
initAppliesToLineWidget();