dedupe linter.enableForEditor calls
This commit is contained in:
parent
184b6d4f7c
commit
a06697808f
|
@ -89,6 +89,7 @@ lazyInit();
|
||||||
dirty.onChange(updateDirty);
|
dirty.onChange(updateDirty);
|
||||||
await editor.ready;
|
await editor.ready;
|
||||||
|
|
||||||
|
setTimeout(() => editor.getEditors().forEach(linter.enableForEditor));
|
||||||
// enabling after init to prevent flash of validation failure on an empty name
|
// enabling after init to prevent flash of validation failure on an empty name
|
||||||
$('#name').required = !editor.isUsercss;
|
$('#name').required = !editor.isUsercss;
|
||||||
$('#save-button').onclick = editor.save;
|
$('#save-button').onclick = editor.save;
|
||||||
|
|
|
@ -517,7 +517,6 @@ function SectionsEditor() {
|
||||||
if (!originalSections.length) {
|
if (!originalSections.length) {
|
||||||
setGlobalProgress();
|
setGlobalProgress();
|
||||||
requestAnimationFrame(fitToAvailableSpace);
|
requestAnimationFrame(fitToAvailableSpace);
|
||||||
sections.forEach(({cm}) => setTimeout(linter.enableForEditor, 0, cm));
|
|
||||||
done();
|
done();
|
||||||
} else {
|
} else {
|
||||||
setTimeout(chunk);
|
setTimeout(chunk);
|
||||||
|
|
|
@ -90,7 +90,6 @@ function SourceEditor() {
|
||||||
linter.run();
|
linter.run();
|
||||||
updateLinterSwitch();
|
updateLinterSwitch();
|
||||||
});
|
});
|
||||||
debounce(linter.enableForEditor, 0, cm);
|
|
||||||
if (!$.isTextInput(document.activeElement)) {
|
if (!$.isTextInput(document.activeElement)) {
|
||||||
cm.focus();
|
cm.focus();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user