speedup usercss opening: combine a few ops
This commit is contained in:
parent
15c98bac9e
commit
5a9227ce8c
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user